Skip to content

Commit 474f06d

Browse files
trivikraduh95
authored andcommitted
debugger: preserve overlapping CDP request state
A Debugger.paused event can arrive before the response to the resume request that triggered it. The resulting probe evaluation replaces the resume request in `inFlight`, but the resume cleanup then clears the newer request's state. Only clear `inFlight` when it still refers to the request being completed. This preserves probe attribution when the target exits during evaluation. Clarify the existing end-to-end test coverage for this case. Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: openai:gpt-5.6-sol PR-URL: #64467 Refs: https://github.com/nodejs/reliability/issues?q=sort%3Aupdated-desc%20test-debugger-probe-failure-process-exit Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
1 parent fffd8a7 commit 474f06d

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

lib/internal/debugger/inspect_probe.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,8 @@ class ProbeInspectorSession {
750750

751751
async callCdp(method, params, probe = null) {
752752
if (this.finished) { throw kInspectorFailedSentinel; }
753-
this.inFlight = { __proto__: null, method, probe };
753+
const request = { __proto__: null, method, probe };
754+
this.inFlight = request;
754755
debug('CDP -> %s%s', method, probe !== null ? `, probe=${probe.index}` : '');
755756
try {
756757
const result = await this.client.callMethod(method, params);
@@ -806,7 +807,9 @@ class ProbeInspectorSession {
806807
}
807808
throw kInspectorFailedSentinel;
808809
} finally {
809-
this.inFlight = null;
810+
if (this.inFlight === request) {
811+
this.inFlight = null;
812+
}
810813
}
811814
}
812815

0 commit comments

Comments
 (0)