Browse Source

Silence throttled messages.

master
Con Kolivas 7 years ago
parent
commit
30eda17bc3
  1. 15
      src/stratifier.c

15
src/stratifier.c

@ -3275,9 +3275,14 @@ static void __drop_client(sdata_t *sdata, stratum_instance_t *client, bool lazil
if (client->workername) { if (client->workername) {
if (user) { if (user) {
ASPRINTF(msg, "Dropped client %s %s %suser %s worker %s %s", /* No message anywhere if throttled, too much flood and
client->identity, client->address, user->throttled ? "throttled " : "", * these only can be LOGNOTICE messages.
*/
if (!user->throttled) {
ASPRINTF(msg, "Dropped client %s %suser %s worker %s %s",
client->identity, client->address,
user->username, client->workername, lazily ? "lazily" : ""); user->username, client->workername, lazily ? "lazily" : "");
}
} else { } else {
ASPRINTF(msg, "Dropped client %s %s no user worker %s %s", ASPRINTF(msg, "Dropped client %s %s no user worker %s %s",
client->identity, client->address, client->workername, client->identity, client->address, client->workername,
@ -5585,10 +5590,16 @@ static void client_auth(ckpool_t *ckp, stratum_instance_t *client, user_instance
user->failed_authtime = 0; user->failed_authtime = 0;
user->auth_backoff = DEFAULT_AUTH_BACKOFF; /* Reset auth backoff time */ user->auth_backoff = DEFAULT_AUTH_BACKOFF; /* Reset auth backoff time */
user->throttled = false; user->throttled = false;
} else {
if (user->throttled) {
LOGINFO("Client %s %s worker %s failed to authorise as throttled user %s",
client->identity, client->address, client->workername,
user->username);
} else { } else {
LOGNOTICE("Client %s %s worker %s failed to authorise as user %s", LOGNOTICE("Client %s %s worker %s failed to authorise as user %s",
client->identity, client->address, client->workername, client->identity, client->address, client->workername,
user->username); user->username);
}
user->failed_authtime = time(NULL); user->failed_authtime = time(NULL);
user->auth_backoff <<= 1; user->auth_backoff <<= 1;
/* Cap backoff time to 10 mins */ /* Cap backoff time to 10 mins */

Loading…
Cancel
Save