Repository navigation
Conversation
This branch has not been deployed
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.
coder support bundle <workspace>hung indefinitely when the workspace agent had a record but was unreachable.DialAgentwaits for the agent to become reachable using the caller's context, and the bundle passed its unbounded parent context, so the command blocked until Ctrl-C and wrote no bundle.This command uploads a number of giagnostics from both the server and agent, including pprof. If the agent is unreachable, this should still be able to write out as much of the bundle as possible without timing out.
The agent dial now has a configurable time limit (
Deps.AgentDialTimeout, default 30s). On timeout the bundle logs a warning, skips the sections that need a live agent connection (ping, peer diagnostics, magicsock, manifest, agent logs over tailnet, listening ports, workspace files, agent pprof), and still writes out the bundle. This includes agent logs fetched through the API. The CLI prints a warning and records it incli_logs.txt; exit status stays 0.Other changes:
support.AgentInfonow takes the dial timeout and also reports whether the agent was reachable.Verification and decision log
Reproduction. An end-to-end CLI test seeds a workspace whose build has an agent record but never starts an agent process, then runs
coder support bundle <ws> --yeswith a 90s outer deadline.mainlogs.txtcontainsagent unreachable, skipping agent-connected sectionsandcli_logs.txtcontainscould not connect to workspace agent.TestRun/AgentUnreachableinsupport/support_test.gocovers both--pprofoff and on.Decisions.
DialAgentitself (workspacesdk.go,AwaitReachable(dialCtx)), not inPing, so the time limit goes on the context passed toDialAgent. That function keeps the connection alive on a separate background context, so cancelling the dial context after a successful dial doesn't close the connection.