[njs] QuickJS: ignoring rejected promises while destroying context.

noreply at nginx.com noreply at nginx.com
Tue Apr 8 05:15:02 UTC 2025


details:   https://github.com/nginx/njs/commit/113fac87c8a123d0627e82cfe3771334baa11edd
branches:  master
commit:    113fac87c8a123d0627e82cfe3771334baa11edd
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Mon, 7 Apr 2025 18:28:50 -0700
description:
QuickJS: ignoring rejected promises while destroying context.


---
 nginx/ngx_js.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/nginx/ngx_js.c b/nginx/ngx_js.c
index ba0fee92..316a2076 100644
--- a/nginx/ngx_js.c
+++ b/nginx/ngx_js.c
@@ -1155,6 +1155,8 @@ ngx_engine_qjs_destroy(ngx_engine_t *e, ngx_js_ctx_t *ctx,
                           "js unhandled rejection: %V", &exception);
         }
 
+        JS_SetHostPromiseRejectionTracker(JS_GetRuntime(cx), NULL, NULL);
+
         class_id = JS_GetClassID(ngx_qjs_arg(ctx->args[0]));
         opaque = JS_GetOpaque(ngx_qjs_arg(ctx->args[0]), class_id);
         opaque->external = NULL;


More information about the nginx-devel mailing list