Dmitry Volyntsev
October 16, 2023 09:12PM
details: https://hg.nginx.org/njs/rev/714fae197d83
branches:
changeset: 2220:714fae197d83
user: Dmitry Volyntsev <xeioex@nginx.com>
date: Mon Oct 16 18:09:37 2023 -0700
description:
Modules: fixed items() method of a shared dictionary.

Previously, under a memory pressure the method might return
prematurely while still holding the mutex for the shared memory.

This fixes #676 issue on Github.

diffstat:

nginx/ngx_js_shared_dict.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r b49a98886c02 -r 714fae197d83 nginx/ngx_js_shared_dict.c
--- a/nginx/ngx_js_shared_dict.c Fri Oct 06 16:52:23 2023 -0700
+++ b/nginx/ngx_js_shared_dict.c Mon Oct 16 18:09:37 2023 -0700
@@ -819,7 +819,7 @@ njs_js_ext_shared_dict_items(njs_vm_t *v

rc = njs_vm_array_alloc(vm, kv, 2);
if (rc != NJS_OK) {
- return NJS_ERROR;
+ goto fail;
}

value = njs_vm_array_push(vm, kv);
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] Modules: fixed items() method of a shared dictionary.

Dmitry Volyntsev 339 October 16, 2023 09:12PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 72
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready