Skip to content

Commit c3b8898

Browse files
authored
fix(coderd/unhanger): de-duplicate logs (#8686)
The final warning just repeated previous lines.
1 parent c9ade6f commit c3b8898

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

coderd/unhanger/detector.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,6 @@ func (d *Detector) Start() {
140140
if stats.Error != nil && !xerrors.As(stats.Error, &acquireLockError{}) {
141141
d.log.Warn(d.ctx, "error running workspace build hang detector once", slog.Error(stats.Error))
142142
}
143-
if len(stats.TerminatedJobIDs) != 0 {
144-
d.log.Warn(d.ctx, "detected (and terminated) hung provisioner jobs", slog.F("job_ids", stats.TerminatedJobIDs))
145-
}
146143
if d.stats != nil {
147144
select {
148145
case <-d.ctx.Done():
@@ -251,7 +248,10 @@ func unhangJob(ctx context.Context, log slog.Logger, db database.Store, pub pubs
251248
}
252249
}
253250

254-
log.Info(ctx, "detected hung (>5m) provisioner job, forcefully terminating")
251+
log.Warn(
252+
ctx, "detected hung provisioner job, forcefully terminating",
253+
"threshold", HungJobDuration,
254+
)
255255

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

0 commit comments

Comments
 (0)