]> git.kaiwu.me - njs.git/commit
Modules: preserve shared dict entries on failed updates
authorDmitry Volyntsev <xeioex@nginx.com>
Tue, 11 Aug 2026 21:29:33 +0000 (14:29 -0700)
committerDmitry Volyntsev <xeioexception@gmail.com>
Thu, 15 Oct 2026 01:49:05 +0000 (18:49 -0700)
commit9a074ab066c2c7de5a0d1bec36ce676c3c2354a6
tree4af33bf6d46d7e0b162dd0d6008cd5b94c1bf789
parentd01fbe55dc8374453195a487e2723366e22246ca
Modules: preserve shared dict entries on failed updates

Shared dictionary updates temporarily remove timeout entries from the
expiration rbtree to prevent eviction while allocating a replacement.
ngx_rbtree_delete() clears the removed node key, so the failure path
reinserted the entry with a zero expiration and made its old value appear
expired.

Factor the shared-memory update into an engine-independent helper and
restore the previous expiration when allocation fails.  Keep value
conversion in the njs and QuickJS wrappers.
nginx/ngx_js_shared_dict.c
nginx/t/js_shared_dict.t