Skip to content

Differentiate between coder agent disconnect and shutdown #11298

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mafredri opened this issue Dec 20, 2023 · 2 comments
Closed

Differentiate between coder agent disconnect and shutdown #11298

mafredri opened this issue Dec 20, 2023 · 2 comments
Labels
stale This issue is like stale bread.

Comments

@mafredri
Copy link
Member

In some cases, it's possible that the coder agent has gracefully exited inside a workspace (let's say a VM is turned off).

It would be nice to reflect this state in the coder UI (web/cli) instead of simply stating that "the agent lost connection".

Currently, this state is detectable:

❯ coder list --output=json | jq -r '.[] | select(.name == "w") | .latest_build.resources[].agents[]? | .lifecycle_state'
ready

❯ ssh coder.w 'pkill -INT -f "coder agent"'

❯ coder list --output=json | jq -r '.[] | select(.name == "w") | .latest_build.resources[].agents[]? | .lifecycle_state'
off

Currently the web shows "disconnected"/unhealthy, and the CLI also shows no warning (e.g. coder ssh simply, seemingly, hangs).

In the shutting_down/off state, there is a good chance the agent isn't coming back, so we should inform the user.

Note: Even though the coder agent supports reporting this, it's dependent on how the shutdown process of the e.g. VM terminates the agent.

@cdr-bot cdr-bot bot added the feature label Dec 20, 2023
@matifali
Copy link
Member

As a workaround, we can make the coder_agent ephemeral by setting count = data.coder_worksapce.me.start_count. But your suggestion looks like a true solution.

@mafredri
Copy link
Member Author

@matifali I think that's a separate issue and something we may consider for other functionality. This suggestions doesn't directly tie into terraform, per-se.

@github-actions github-actions bot added the stale This issue is like stale bread. label Jun 18, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale This issue is like stale bread.
Projects
None yet
Development

No branches or pull requests

2 participants