Repository navigation
Report an infrastructure failure when the debugger Dev Tunnel fails - #4610
Merged
Merged
Conversation
A debugger job silently degraded when its Dev Tunnel relay broke. A failed relay connect was reported as a plain job error, and a relay that dropped after connecting was invisible entirely — the job just hung on a DAP pause until the job timeout, because the debug client could no longer resume it. Both now report the `debugger_tunnel_failure` infrastructure category so the service can attribute the failure to infrastructure rather than the user: - StartTunnelRelayAsync wraps connect failures (including the 30s connect timeout) in DebuggerTunnelException, which JobExtension catches and turns into an InfrastructureError on "Set up job". - DapDebugger subscribes to the relay's ConnectionStatusChanged and, on a settled Disconnected that we didn't cause, sets the category, fails the job, and releases any pending DAP pause so it stops waiting. A client-connect timeout is deliberately left as a plain error — the tunnel was healthy, the user simply never attached. Co-authored-by: Copilot App <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds explicit runner infrastructure failure reporting for Dev Tunnel relay failures in debugger (DAP) jobs, ensuring tunnel connect failures and unexpected mid-job disconnects are surfaced and don’t leave jobs hanging until timeout.
Changes:
- Introduces
DebuggerTunnelExceptionand reports tunnel-connect failures asInfrastructureErrorwith categorydebugger_tunnel_failure. - Adds Dev Tunnel connection status monitoring to fail the job and release DAP waits on unexpected disconnects.
- Adds L0 tests covering tunnel failure vs. client-attach timeout behavior and disconnect handling.
Show a summary per file
| File | Description |
|---|---|
| src/Test/L0/Worker/JobExtensionL0.cs | Adds L0 coverage for infra-failure reporting on tunnel connect failure vs. user attach timeout. |
| src/Test/L0/Worker/DapDebuggerL0.cs | Adds L0 coverage for unexpected tunnel disconnect behaviors (fail once, ignore teardown, release waits). |
| src/Runner.Worker/JobExtension.cs | Treats DebuggerTunnelException as infrastructure failure (vs. generic debugger errors). |
| src/Runner.Worker/Dap/DebuggerTunnelException.cs | Adds a dedicated exception type to distinguish tunnel failures from attach timeouts. |
| src/Runner.Worker/Dap/DapDebugger.cs | Wraps tunnel connect errors, subscribes to tunnel status changes, and fails job on unexpected disconnects. |
| src/Runner.Common/Constants.cs | Adds infrastructure failure category constant debugger_tunnel_failure. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 2
- Review effort level: Lite
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 57a800c5-eb52-4866-9bba-a3f5c0faf3d8
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 57a800c5-eb52-4866-9bba-a3f5c0faf3d8
Contributor
There was a problem hiding this comment.
Review details
Suppressed comments (1)
src/Runner.Worker/JobExtension.cs:678
- This catch reports an infrastructure failure via
context.InfrastructureError(...), but it then rethrows and will be caught again by the outercatch (Exception ex)inInitializeJob, which callscontext.Error(ex)and records a second (non-infrastructure) error issue with the same message. That makes the tunnel failure show up as both an infrastructure issue and a regular step error.
Consider adding an outer catch (DebuggerTunnelException) (before the general catch) that sets context.Result and rethrows without calling context.Error(...), or have the general catch skip context.Error(ex) when ex is a DebuggerTunnelException that has already been reported as infrastructure.
context.InfrastructureError(
ex.Message,
category: Constants.Runner.InfrastructureFailureCategories.DebuggerTunnelFailure);
throw;
}
- Files reviewed: 6/6 changed files
- Comments generated: 1
- Review effort level: Lite
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 57a800c5-eb52-4866-9bba-a3f5c0faf3d8
rentziass
marked this pull request as ready for review
August 6, 2026 10:04
salmanmkc
approved these changes
Aug 6, 2026
rentziass
enabled auto-merge (squash)
August 6, 2026 12:02
This was referenced Sep 1, 2026
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reports a runner infrastructure failure when a debugger job's Dev Tunnel connection cannot be established, or drops mid-job. Previously both cases surfaced as a plain step error (or, for a mid-job drop, were invisible entirely — the job would sit on a DAP pause until the job timeout).
Infrastructure failure category:
debugger_tunnel_failure(Constants.Runner.InfrastructureFailureCategories.DebuggerTunnelFailure). The matching case in run-service is being added separately.Behaviour:
DebuggerTunnelExceptionand reported viaInfrastructureErrorfrom "Set up job".StopAsyncteardown are ignored via an explicit shutdown flag, and transient reconnect transitions are not treated as failures.context.Error(...)behaviour. There is a regression test for this.github/actions-runtime#5587