]> git.kaiwu.me - njs.git/commit
Modules: clear QuickJS hooks before a context is reused master
authorDmitry Volyntsev <xeioex@nginx.com>
Thu, 12 Nov 2026 01:37:06 +0000 (17:37 -0800)
committerDmitry Volyntsev <xeioexception@gmail.com>
Thu, 12 Nov 2026 22:29:31 +0000 (14:29 -0800)
commit548e5179b582e4701273c68d9be00e4627b0fd6b
tree982ee07355c5f7a7fb5b068f77c2915ba1bb76ba
parent549ee59ac3772ca5f3c4b824369d59c0dbfd7bca
Modules: clear QuickJS hooks before a context is reused

Previously, an exit hook installed during context teardown, for example
by a promise job queued by the exit hook, was kept in the context.  When
the context was reused, the hook was called during the teardown of a
later request.

Now hooks are cleared together with the pending events, after the last
user code of the request has run.

The issue was introduced in 04f6dfb9 (0.9.2).
nginx/ngx_js.c
nginx/t/js_teardown.t
src/qjs.c
src/qjs.h