]> git.kaiwu.me - njs.git/commit
Fixed tracking of unhandled rejected promises.
authorDmitry Volyntsev <xeioex@nginx.com>
Fri, 19 Jan 2024 02:03:24 +0000 (18:03 -0800)
committerDmitry Volyntsev <xeioex@nginx.com>
Fri, 19 Jan 2024 02:03:24 +0000 (18:03 -0800)
commite1120a2d82468fe7e403c12ab7b37e779f1160fd
treee5387438a7ae6a050c42dd1459ea67f527e619fa
parent5b007e8a919b1daaed1026b25ddef862b19eefc7
Fixed tracking of unhandled rejected promises.

Checking for unhandled promise rejections while looping for pending jobs
produces false-positive reports when an rejected promised is handled
by one of the pending jobs later.

The fix is to check for unhandled promise rejections only at top level
calls like ngx_js_name_invoke() and ngx_js_name_call() and only after
all pending jobs are processed.

The issue was introduced in bc80bcb3102c (not released yet).
external/njs_shell.c
nginx/ngx_js.c
src/test/njs_externals_test.c
src/test/njs_unit_test.c