Timeout in 5 seconds on the stratum read socket allowing us to detect closed connections sooner
This commit is contained in:
parent
acfa048991
commit
1ac5fec1ee
@ -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);
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user