diff --git a/src/generator.c b/src/generator.c index fced81d0..b4fff498 100644 --- a/src/generator.c +++ b/src/generator.c @@ -897,8 +897,8 @@ static void *proxy_recv(void *arg) while (42) { notify_instance_t *ni, *tmp; share_msg_t *share, *tmpshare; + int retries = 0, ret; time_t now; - int ret; now = time(NULL); @@ -923,7 +923,12 @@ static void *proxy_recv(void *arg) } mutex_unlock(&proxi->share_lock); - ret = read_socket_line(cs, 120); + /* If we don't get an update within 2 minutes the upstream pool + * has likely stopped responding. */ + do { + ret = read_socket_line(cs, 5); + } while (ret == 0 && ++retries < 24); + if (ret < 1) { LOGWARNING("Failed to read_socket_line in proxy_recv, attempting reconnect"); reconnect_stratum(cs, proxi); diff --git a/src/libckpool.c b/src/libckpool.c index 2d034d71..4dbdb4b1 100644 --- a/src/libckpool.c +++ b/src/libckpool.c @@ -492,7 +492,7 @@ int read_socket_line(connsock_t *cs, int timeout) continue; if (ret < 1) { if (!ret) - LOGNOTICE("Select timed out in read_socket_line"); + LOGDEBUG("Select timed out in read_socket_line"); else LOGERR("Select failed in read_socket_line"); goto out;