Cancel pending heartbeat when activity completes#2526
Cancel pending heartbeat when activity completes#2526Quinn-With-Two-Ns merged 1 commit intotemporalio:masterfrom
Conversation
| // if the activity is not completed, we need to cancel the heartbeat | ||
| // to avoid sending it after the activity is completed | ||
| context.cancelOutstandingHeartbeat(); |
There was a problem hiding this comment.
Can you clarify this a bit? So except for async-activity-completion, this is going to prevent a pending heartbeat from being recorded? Is there somewhere else in Java where the last heartbeat of a failing activity is guaranteed to be sent?
There was a problem hiding this comment.
Is there somewhere else in Java where the last heartbeat of a failing activity is guaranteed to be sent?
Yes, we send the last heartbeat value as part of the activity failure.
There was a problem hiding this comment.
So to double-extra confirm, this is guaranteed only for non-async-activity-complete situations where the task is already complete, and therefore this logic will never cause a lost heartbeat at the end?
There was a problem hiding this comment.
Yes, we never loose a heartbeat since we always send the last hearbeat as part of activity failure
c1c97e8 to
8ba5afb
Compare
8ba5afb to
859ccab
Compare
Cancel pending heartbeat when activity completes. This prevents the heartbeat from holding up worker shutdown and prevents heartbeating an already completed activity
closes: #1256