MCPcopy Index your code
hub / github.com/nodejs/node / startTimeout

Method startTimeout

lib/internal/debugger/inspect_probe.js:840–868  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

838 }
839
840 startTimeout() {
841 this.timeout = setTimeout(() => {
842 debug('timeout fired: finished=%s, inFlight=%j, lastProbeIndex=%s',
843 this.finished, this.inFlight, this.lastProbeIndex);
844 if (this.finished) { return; }
845 if (this.inFlight !== null) {
846 const hasProbeAttribution =
847 this.inFlight.probe !== null || this.lastProbeIndex !== null;
848 this.recordInspectorFailure({
849 reason: 'Probe session timed out',
850 advice: hasProbeAttribution ?
851 ('The probe expression may be slow, hanging, or interfering with the inspector connection. ' +
852 'Try increasing `--timeout`; if the failure persists, review the probe expressions.') :
853 'Try increasing `--timeout`; if the failure persists, please file an issue.',
854 });
855 return;
856 }
857 const pending = this.getPendingProbeIndices();
858 const message = `Timed out after ${this.options.timeout}ms waiting for ` +
859 (pending.length === 0 ? 'target completion' :
860 `probes: ${formatPendingProbeLocations(this.probes, pending)}`);
861 this.finishWithUnreliableResult({
862 event: 'timeout',
863 pending,
864 error: { code: 'probe_timeout', message },
865 });
866 }, this.options.timeout);
867 this.timeout.unref();
868 }
869
870 attachListeners() {
871 this.child.on('exit', this.onChildExit);

Callers 1

runMethod · 0.95

Calls 7

setTimeoutFunction · 0.50
debugFunction · 0.50
unrefMethod · 0.45

Tested by

no test coverage detected