Skip to content

Commit 57ebdd3

Browse files
committed
bugfix: should still use timer instead of delayed_events when worker process is exiting,
otherwise the new created 0 delay timer may have no chance to run.
1 parent ff81634 commit 57ebdd3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ngx_http_lua_timer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ ngx_http_lua_ngx_timer_helper(lua_State *L, int every)
329329
lmcf->pending_timers++;
330330

331331
#ifdef HAVE_POSTED_DELAYED_EVENTS_PATCH
332-
if (delay == 0) {
332+
if (delay == 0 && !ngx_exiting) {
333333
dd("posting 0 sec sleep event to head of delayed queue");
334334
ngx_post_event(ev, &ngx_posted_delayed_events);
335335

0 commit comments

Comments
 (0)