]> git.kaiwu.me - njs.git/commit
QuickJS: discard contexts with pending jobs
authorDmitry Volyntsev <xeioex@nginx.com>
Fri, 14 Aug 2026 03:50:52 +0000 (20:50 -0700)
committerDmitry Volyntsev <xeioexception@gmail.com>
Fri, 14 Aug 2026 23:05:54 +0000 (16:05 -0700)
commit77957549577aaa23b458b3f4d905d2268fadfc47
treeeaebd33abad925bba8de9d0566e4d054dd2108ee
parente2087450109fe336ecca25ed350f120586a6c46f
QuickJS: discard contexts with pending jobs

A job exception stops the teardown drain immediately.  Jobs left behind
could then run after the context was bound to another request.  Releasing
events and root values after the drain could also enqueue new jobs with
the same result.

Treat a successful, complete job drain as a precondition for context
reuse.  Destroy the runtime when the drain fails or the queue becomes
nonempty during the remaining teardown.
nginx/ngx_js.c