Fix client lost due to sleep #3549
Merged
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.
Description
Following testing with #3547, I found that the k8s socket client is declared lost. Turns out I added this bug in #3534: https://github.com/buildkite/agent/pull/3534/files#diff-51d41708fc2008e12931e74e692c6f91783e8bcf211364ea4c89813866c89f2aR174-R182
Context
Fix one more bug for https://linear.app/buildkite/issue/PS-1220
Changes
Put the sleep and subsequent exit in a goroutine, to unblock the
StatusLoop, so that the server side doesn't time out and consider the client side lost.Testing
go test ./...). Buildkite employees may check this if the pipeline has run automatically.go fmt ./...)Disclosures / Credits
Wet noodles in a skull