Skip to content

Commit

Permalink
worker/server: log unresponsive job removal
Browse files Browse the repository at this point in the history
Re-add the logging for when unresponsive heartbeats
are being removed so we can verify that they
are correctly being logged as 5xx errors.
  • Loading branch information
kingsleyzissou authored and thozza committed Jan 10, 2023
1 parent fe554ad commit 08aa1e9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/worker/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ func (s *Server) WatchHeartbeats() {
//nolint:staticcheck // avoid SA1015, this is an endless function
for range time.Tick(time.Second * 30) {
for _, token := range s.jobs.Heartbeats(time.Second * 120) {
id, _ := s.jobs.IdFromToken(token)
logrus.Infof("Removing unresponsive job: %s\n", id)

missingHeartbeatResult := JobResult{
JobError: clienterrors.WorkerClientError(clienterrors.ErrorJobMissingHeartbeat,
fmt.Sprintf("Workers running this job stopped responding more than %d times.", maxHeartbeatRetries),
Expand Down

0 comments on commit 08aa1e9

Please sign in to comment.