]> git.kaiwu.me - njs.git/commit
QuickJS: fix unhandled rejection tracking in reused contexts master
authorDmitry Volyntsev <xeioex@nginx.com>
Thu, 2 Jul 2026 23:19:32 +0000 (16:19 -0700)
committerDmitry Volyntsev <xeioexception@gmail.com>
Fri, 3 Jul 2026 00:40:33 +0000 (17:40 -0700)
commite7eac4565bd0933e9ee066098109abbe6ce06650
tree919fcafc03ab45c33e785d8ece5b88d8f5e5f648
parent6576aa136078488e54337dc7143a696a4cdadef2
QuickJS: fix unhandled rejection tracking in reused contexts

ngx_qjs_destroy() unregisters the host promise rejection tracker on the
runtime, but ngx_qjs_clone() did not re-register it when a context was
popped from the reuse queue.  Every request served by a reused context
then silently dropped unhandled rejections instead of reporting them,
which also defeated any caller relying on ctx->rejected_promises.
nginx/ngx_js.c
nginx/t/js_context_reuse.t [new file with mode: 0644]