Skip to content

fix(coderd/unhanger): de-duplicate logs #8686

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 1 commit into from
Jul 24, 2023
Merged
Changes from all 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
8 changes: 4 additions & 4 deletions coderd/unhanger/detector.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,6 @@ func (d *Detector) Start() {
if stats.Error != nil && !xerrors.As(stats.Error, &acquireLockError{}) {
d.log.Warn(d.ctx, "error running workspace build hang detector once", slog.Error(stats.Error))
}
if len(stats.TerminatedJobIDs) != 0 {
d.log.Warn(d.ctx, "detected (and terminated) hung provisioner jobs", slog.F("job_ids", stats.TerminatedJobIDs))
}
if d.stats != nil {
select {
case <-d.ctx.Done():
Expand Down Expand Up @@ -251,7 +248,10 @@ func unhangJob(ctx context.Context, log slog.Logger, db database.Store, pub pubs
}
}

log.Info(ctx, "detected hung (>5m) provisioner job, forcefully terminating")
log.Warn(
ctx, "detected hung provisioner job, forcefully terminating",
"threshold", HungJobDuration,
)

// First, get the latest logs from the build so we can make sure
// our messages are in the latest stage.
Expand Down