Skip to content

fix(coderd): Ensure agent disconnect happens after timeout #6600

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

Merged
merged 2 commits into from
Mar 14, 2023

Conversation

mafredri
Copy link
Member

Fixes #6598

@mafredri mafredri self-assigned this Mar 14, 2023
@mafredri mafredri requested review from kylecarbs and mtojek March 14, 2023 12:50
@mtojek mtojek changed the title fix(coderd): Ensure agent disconnet happens after timeout fix(coderd): Ensure agent disconnect happens after timeout Mar 14, 2023
@@ -175,6 +175,10 @@ func New(options *Options) *API {
if options.AgentInactiveDisconnectTimeout == 0 {
// Multiply the update by two to allow for some lag-time.
options.AgentInactiveDisconnectTimeout = options.AgentConnectionUpdateFrequency * 2
// Set a minimum timeout to avoid disconnecting too soon.
if options.AgentInactiveDisconnectTimeout < 2*time.Second {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2*time.Second

Interesting, doesn't make fmt complain about it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually fmt's handiwork. It groups operands when there are multiple operators.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL!

@mafredri mafredri enabled auto-merge (squash) March 14, 2023 13:13
@mafredri mafredri merged commit 3485300 into main Mar 14, 2023
@mafredri mafredri deleted the mafredri/fix-agent-disconnect-too-early branch March 14, 2023 13:14
@github-actions github-actions bot locked and limited conversation to collaborators Mar 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

skip tests: scaletest/reconnectingpty Test_Runner
3 participants