Browse Source

Timeout on failed discarding of staged requests.

nfactor-troky
Con Kolivas 14 years ago
parent
commit
0ba06c69f9
  1. 10
      main.c

10
main.c

@ -1532,6 +1532,8 @@ static bool queue_request(void)
static void discard_staged(void) static void discard_staged(void)
{ {
struct timespec abstime = {};
struct timeval now;
struct work *work_heap; struct work *work_heap;
struct pool *pool; struct pool *pool;
@ -1539,7 +1541,10 @@ static void discard_staged(void)
if (unlikely(!requests_staged())) if (unlikely(!requests_staged()))
return; return;
work_heap = tq_pop(getq, NULL); gettimeofday(&now, NULL);
abstime.tv_sec = now.tv_sec + 60;
work_heap = tq_pop(getq, &abstime);
if (unlikely(!work_heap)) if (unlikely(!work_heap))
return; return;
@ -1603,7 +1608,8 @@ retry:
/* Only print this message once each time we shift to localgen */ /* Only print this message once each time we shift to localgen */
if (!pool_tset(pool, &pool->idle)) { if (!pool_tset(pool, &pool->idle)) {
applog(LOG_WARNING, "Server not providing work fast enough, generating work locally"); applog(LOG_WARNING, "Pool %d not providing work fast enough, generating work locally",
pool->pool_no);
pool->localgen_occasions++; pool->localgen_occasions++;
total_lo++; total_lo++;
gettimeofday(&pool->tv_idle, NULL); gettimeofday(&pool->tv_idle, NULL);

Loading…
Cancel
Save