-
Notifications
You must be signed in to change notification settings - Fork 887
chore: shutdown provisioner should stop waiting on client #13118
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we get a unit test?
This fails on `main`
@spikecurtis test added: coder/provisionerd/provisionerd_test.go Lines 602 to 630 in 418c4dd
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
|
||
// Wait for at least 1 attempt to connect to ensure the connect go routine | ||
// is running. | ||
require.Condition(t, closedWithin(connectAttempted, testutil.WaitShort)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just FYI, we have testutil.RequireRecvCtx()
which is what I usually use for this sort of thing.
provisionerd
does not respond toctrl+c
if no coderd exits.Run
go run main.go provisionerd start
without a coderd. After a second or two, hitctrl +c
. The process will not terminate. The issue is we callShutdown
for a graceful closure.Currently:
connect()
does not terminate on shutdown. Only onClose
Shutdown
does not call close. The caller needs to callShutdown
and thenClose
. Updated the cli to do this, although it is not intuitive imo.acquireLoop
blocks on a client, but if no client is ever established, the shutdown never gets checked, and this blocks forever.This PR calls
Close
afterShutdown
and makesp.client()
return a nil client during shutdown.I'd like to see provisionerd's
Shutdown
callClose
.