Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions enterprise/cli/provisionerdaemons.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,7 @@ func (r *RootCmd) provisionerDaemonStart() *clibase.Cmd {
cliui.Errorf(inv.Stderr, "Unexpected error, shutting down server: %s\n", exitErr)
}

shutdown, shutdownCancel := context.WithTimeout(ctx, time.Minute)
defer shutdownCancel()
err = srv.Shutdown(shutdown)
err = srv.Shutdown(ctx)
Copy link
Member

Choose a reason for hiding this comment

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

What effect will this have outside of a Kubernetes environment if we have a build in progress that just hangs indefinitely?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It will do what we describe earlier in this file:

"Interrupt caught, gracefully exiting. Use ctrl+\\ to force quit", that is, we'll wait indefinitely until we get a more aggressive signal like SIGQUIT (ctrl + \) or SIGKILL.

if err != nil {
return xerrors.Errorf("shutdown: %w", err)
}
Expand Down
1 change: 1 addition & 0 deletions helm/provisioner/templates/_coder.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Deployment to merge into the libcoder template
spec:
template:
spec:
terminationGracePeriodSeconds: {{ .Values.provisionerDaemon.terminationGracePeriodSeconds }}
containers:
-
{{ include "libcoder.containerspec" (list . "coder.containerspec") | indent 8}}
Expand Down
5 changes: 5 additions & 0 deletions helm/provisioner/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,8 @@ provisionerDaemon:
{}
# location: usa
# provider: kubernetes

# provisionerDaemon.terminationGracePeriodSeconds -- Time in seconds that Kubernetes should wait before forcibly
# terminating the provisioner daemon. You should set this to be longer than your longest expected build time so that
# redeployments do not interrupt builds in progress.
terminationGracePeriodSeconds: 600