@@ -350,6 +350,9 @@ ngx_http_lua_ngx_timer_helper(lua_State *L, int every)
350
350
351
351
ngx_add_timer (ev , delay );
352
352
353
+ ngx_log_debug2 (NGX_LOG_DEBUG_HTTP , ngx_cycle -> log , 0 ,
354
+ "created timer (co: %p delay: %M ms)" , tctx -> co , delay );
355
+
353
356
lua_pushinteger (L , 1 );
354
357
return 1 ;
355
358
@@ -509,6 +512,10 @@ ngx_http_lua_timer_copy(ngx_http_lua_timer_ctx_t *old_tctx)
509
512
510
513
ngx_add_timer (ev , tctx -> delay );
511
514
515
+ ngx_log_debug2 (NGX_LOG_DEBUG_HTTP , ngx_cycle -> log , 0 ,
516
+ "created next timer (co: %p delay: %M ms)" , tctx -> co ,
517
+ tctx -> delay );
518
+
512
519
return NGX_OK ;
513
520
514
521
nomem :
@@ -580,6 +587,9 @@ ngx_http_lua_timer_handler(ngx_event_t *ev)
580
587
581
588
c = ngx_http_lua_create_fake_connection (tctx .pool );
582
589
if (c == NULL ) {
590
+ ngx_log_error (NGX_LOG_ALERT , ngx_cycle -> log , 0 ,
591
+ "failed to create fake connection to run timer (co: %p)" ,
592
+ tctx .co );
583
593
goto failed ;
584
594
}
585
595
@@ -591,6 +601,9 @@ ngx_http_lua_timer_handler(ngx_event_t *ev)
591
601
592
602
r = ngx_http_lua_create_fake_request (c );
593
603
if (r == NULL ) {
604
+ ngx_log_error (NGX_LOG_ALERT , ngx_cycle -> log , 0 ,
605
+ "failed to create fake request to run timer (co: %p)" ,
606
+ tctx .co );
594
607
goto failed ;
595
608
}
596
609
@@ -626,6 +639,8 @@ ngx_http_lua_timer_handler(ngx_event_t *ev)
626
639
627
640
ctx = ngx_http_lua_create_ctx (r );
628
641
if (ctx == NULL ) {
642
+ ngx_log_error (NGX_LOG_ALERT , ngx_cycle -> log , 0 ,
643
+ "failed to create ctx to run timer (co: %p)" , tctx .co );
629
644
goto failed ;
630
645
}
631
646
@@ -634,6 +649,9 @@ ngx_http_lua_timer_handler(ngx_event_t *ev)
634
649
635
650
pcln = ngx_pool_cleanup_add (r -> pool , 0 );
636
651
if (pcln == NULL ) {
652
+ ngx_log_error (NGX_LOG_ALERT , ngx_cycle -> log , 0 ,
653
+ "failed to add vm cleanup to run timer (co: %p)" ,
654
+ tctx .co );
637
655
goto failed ;
638
656
}
639
657
@@ -647,6 +665,9 @@ ngx_http_lua_timer_handler(ngx_event_t *ev)
647
665
648
666
cln = ngx_http_cleanup_add (r , 0 );
649
667
if (cln == NULL ) {
668
+ ngx_log_error (NGX_LOG_ALERT , ngx_cycle -> log , 0 ,
669
+ "failed to add request cleanup to run timer (co: %p)" ,
670
+ tctx .co );
650
671
goto failed ;
651
672
}
652
673
0 commit comments