From f600c28dc1525315e6ccdda27d7a8ccfe8fd9f9a Mon Sep 17 00:00:00 2001 From: Dmitry Volyntsev Date: Fri, 22 Sep 2023 13:00:04 -0700 Subject: [PATCH] Modules: added debug log for vm cloning and destroying. --- nginx/ngx_http_js_module.c | 6 ++++++ nginx/ngx_stream_js_module.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/nginx/ngx_http_js_module.c b/nginx/ngx_http_js_module.c index 6ba500e7..49f9790f 100644 --- a/nginx/ngx_http_js_module.c +++ b/nginx/ngx_http_js_module.c @@ -1366,6 +1366,9 @@ ngx_http_js_init_vm(ngx_http_request_t *r, njs_int_t proto_id) return NGX_ERROR; } + ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, + "http js vm clone: %p from: %p", ctx->vm, jlcf->vm); + cln = ngx_pool_cleanup_add(r->pool, 0); if (cln == NULL) { return NGX_ERROR; @@ -1425,6 +1428,9 @@ ngx_http_js_cleanup_ctx(void *data) ngx_log_error(NGX_LOG_ERR, ctx->log, 0, "pending events"); } + ngx_log_debug1(NGX_LOG_DEBUG_HTTP, ctx->log, 0, "http js vm destroy: %p", + ctx->vm); + njs_vm_destroy(ctx->vm); } diff --git a/nginx/ngx_stream_js_module.c b/nginx/ngx_stream_js_module.c index a0f1de5d..1540d4b3 100644 --- a/nginx/ngx_stream_js_module.c +++ b/nginx/ngx_stream_js_module.c @@ -1030,6 +1030,9 @@ ngx_stream_js_init_vm(ngx_stream_session_t *s, njs_int_t proto_id) return NGX_ERROR; } + ngx_log_debug2(NGX_LOG_DEBUG_STREAM, s->connection->log, 0, + "stream js vm clone: %p from: %p", ctx->vm, jscf->vm); + cln = ngx_pool_cleanup_add(s->connection->pool, 0); if (cln == NULL) { return NGX_ERROR; @@ -1107,6 +1110,9 @@ ngx_stream_js_cleanup(void *data) ngx_log_error(NGX_LOG_ERR, s->connection->log, 0, "pending events"); } + ngx_log_debug1(NGX_LOG_DEBUG_STREAM, s->connection->log, 0, + "stream js vm destroy: %p", ctx->vm); + njs_vm_destroy(ctx->vm); } -- 2.47.3