Previously, the code did not unlock the rwlock when a dict was empty.
The issue was introduced in
4a15613f4e8b (0.8.3).
This closes issue #699 on Github.
rbtree = &dict->sh->rbtree;
if (rbtree->root == rbtree->sentinel) {
- return NJS_OK;
+ goto done;
}
for (rn = ngx_rbtree_min(rbtree->root, rbtree->sentinel);
}
}
+done:
+
ngx_rwlock_unlock(&dict->sh->rwlock);
njs_value_undefined_set(retval);
function set_clear(r) {
var dict = ngx.shared.no_timeout;
+ dict.clear();
dict.set("test", "test value");
dict.set("test1", "test1 value");
dict.clear();