From b265ed83135b0e708b26be885dd8fadebf4e53cb Mon Sep 17 00:00:00 2001 From: Unbit Date: Mon, 28 Oct 2013 17:09:27 +0100 Subject: [PATCH] avoid kevent storm for stats pusher thread --- core/stats.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/stats.c b/core/stats.c index 22c9e32c..b7738ee1 100644 --- a/core/stats.c +++ b/core/stats.c @@ -440,6 +440,10 @@ void uwsgi_stats_pusher_loop(struct uwsgi_thread *ut) { void *events = event_queue_alloc(1); for (;;) { int nevents = event_queue_wait_multi(ut->queue, 1, events, 1); + if (nevents < 0) { + uwsgi_log_verbose("ending the stats pusher thread...\n"); + return; + } if (nevents > 0) { int interesting_fd = event_queue_interesting_fd(events, 0); char buf[4096];