mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-08-23 17:37:25 +00:00
stratum: ignore possible dup on new user
This race case was causing a stratum exit and should not
This commit is contained in:
parent
343ec492c8
commit
010fd14493
1 changed files with 2 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
||||||
|
|
||||||
#include "stratum.h"
|
#include "stratum.h"
|
||||||
|
#include <mysql/mysqld_error.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
void db_reconnect(YAAMP_DB *db)
|
void db_reconnect(YAAMP_DB *db)
|
||||||
|
@ -70,6 +71,7 @@ void db_query(YAAMP_DB *db, const char *format, ...)
|
||||||
res = mysql_errno(&db->mysql);
|
res = mysql_errno(&db->mysql);
|
||||||
|
|
||||||
stratumlog("SQL ERROR: %d, %s\n", res, mysql_error(&db->mysql));
|
stratumlog("SQL ERROR: %d, %s\n", res, mysql_error(&db->mysql));
|
||||||
|
if(res == ER_DUP_ENTRY) break; // rarely seen on new user creation
|
||||||
if(res != CR_SERVER_GONE_ERROR && res != CR_SERVER_LOST) exit(1);
|
if(res != CR_SERVER_GONE_ERROR && res != CR_SERVER_LOST) exit(1);
|
||||||
|
|
||||||
usleep(100*YAAMP_MS);
|
usleep(100*YAAMP_MS);
|
||||||
|
|
Loading…
Add table
Reference in a new issue