Skip to content

Commit 8c6c655

Browse files
committed
fix hanged logging thread on seed errors
1 parent 806a264 commit 8c6c655

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

util/mapcache_seed.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ static void* APR_THREAD_FUNC log_thread_fn(apr_thread_t *thread, void *data) {
651651
memset(failed,-1,FAIL_BACKLOG_COUNT);
652652
size_t cur=0;
653653
double last_time=0, now_time;
654-
while(error_detected == 0) {
654+
while(1) {
655655
struct seed_status *st;
656656
apr_status_t ret = apr_queue_pop(log_queue, (void**)&st);
657657
if(ret != APR_SUCCESS || !st) break;
@@ -687,6 +687,7 @@ static void* APR_THREAD_FUNC log_thread_fn(apr_thread_t *thread, void *data) {
687687
if(pct > percent_failed_allowed) {
688688
ctx.log(&ctx, MAPCACHE_ERROR, "aborting seed as %.1f%% of the last %d requests failed\n", pct, FAIL_BACKLOG_COUNT);
689689
error_detected = 1;
690+
return NULL;
690691
}
691692
}
692693
if(st->msg) free(st->msg);

0 commit comments

Comments
 (0)