mirror of
https://github.com/coder/coder.git
synced 2025-07-09 11:45:56 +00:00
fix(coderd/provisionerdserver): avoid error log during shutdown (#10402)
This commit is contained in:
committed by
GitHub
parent
fdc9097d6c
commit
0ddd54d34b
@ -1206,6 +1206,13 @@ func (s *server) CompleteJob(ctx context.Context, completed *proto.CompletedJob)
|
|||||||
case <-wait:
|
case <-wait:
|
||||||
// Wait for the next potential timeout to occur.
|
// Wait for the next potential timeout to occur.
|
||||||
if err := s.Pubsub.Publish(codersdk.WorkspaceNotifyChannel(workspaceBuild.WorkspaceID), []byte{}); err != nil {
|
if err := s.Pubsub.Publish(codersdk.WorkspaceNotifyChannel(workspaceBuild.WorkspaceID), []byte{}); err != nil {
|
||||||
|
if s.lifecycleCtx.Err() != nil {
|
||||||
|
// If the server is shutting down, we don't want to log this error, nor wait around.
|
||||||
|
s.Logger.Debug(ctx, "stopping notifications due to server shutdown",
|
||||||
|
slog.F("workspace_build_id", workspaceBuild.ID),
|
||||||
|
)
|
||||||
|
return
|
||||||
|
}
|
||||||
s.Logger.Error(ctx, "workspace notification after agent timeout failed",
|
s.Logger.Error(ctx, "workspace notification after agent timeout failed",
|
||||||
slog.F("workspace_build_id", workspaceBuild.ID),
|
slog.F("workspace_build_id", workspaceBuild.ID),
|
||||||
slog.Error(err),
|
slog.Error(err),
|
||||||
|
Reference in New Issue
Block a user