]> git.kaiwu.me - njs.git/commit
Modules: ignore unknown and non-timer ids in clearTimeout()
authorDmitry Volyntsev <xeioex@nginx.com>
Fri, 30 Oct 2026 05:29:15 +0000 (22:29 -0700)
committerDmitry Volyntsev <xeioexception@gmail.com>
Mon, 2 Nov 2026 14:42:35 +0000 (06:42 -0800)
commit493cfbc75d6e401da7720ca0ee90b915ddede4dc
treeeb45b9ffa302cb6798cb0761c61bb20b2c81535c
parent76b231ac95dca479c7b4312ccfc0167f3609e526
Modules: ignore unknown and non-timer ids in clearTimeout()

Previously, clearTimeout() looked up the id among all pending native
events of the context, so a timer id coinciding with the id of
another event, such as a pending ngx.fetch() or a subrequest, removed
that event and freed its data.  In addition, an exception was thrown
for an unknown id.

Now, only timer events are removed, and unknown ids are ignored, as
required by the specification.

The issue was introduced in 9de30135 (0.8.3).
nginx/ngx_js.c
nginx/t/js_async.t