Skip to content

Commit 4dd2716

Browse files
authored
Only log failed heartbeats if the error is not CanceledError (#1271)
* Lowered the log level to info as this floods logs when canceling workflows * Changed from lowering the error level to just checking if it's a canceled error
1 parent 9fdcd4f commit 4dd2716

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

internal/internal_task_handlers.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1496,7 +1496,10 @@ func (i *cadenceInvoker) heartbeatAndScheduleNextRun(details []byte) error {
14961496

14971497
// Log the error outside the lock.
14981498
if err != nil {
1499-
i.logger.Error("Failed to send heartbeat", zap.Error(err), zap.String(tagWorkflowType, i.workflowType), zap.String(tagActivityType, i.activityType))
1499+
// If the error is a canceled error do not log, as this is expected.
1500+
if _, ok := err.(*CanceledError); !ok {
1501+
i.logger.Error("Failed to send heartbeat", zap.Error(err), zap.String(tagWorkflowType, i.workflowType), zap.String(tagActivityType, i.activityType))
1502+
}
15001503
}
15011504
}()
15021505
}

0 commit comments

Comments
 (0)