-
Notifications
You must be signed in to change notification settings - Fork 123
Activity pause interrupt heartbeat #909
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
Changes from 3 commits
e24fee7
c11dd71
2a017f0
fbd1bc1
bf47c10
7e4bfa2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -142,12 +142,13 @@ impl ActivityHeartbeatManager { | |
| .record_activity_heartbeat(tt.clone(), details.into_payloads()) | ||
| .await | ||
| { | ||
| Ok(RecordActivityTaskHeartbeatResponse { cancel_requested, activity_paused: _ }) => { | ||
| if cancel_requested { | ||
| Ok(RecordActivityTaskHeartbeatResponse { cancel_requested, activity_paused }) => { | ||
| if cancel_requested || activity_paused { | ||
| let reason = if cancel_requested { ActivityCancelReason::Cancelled } else { ActivityCancelReason::Paused}; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fmt is checked by CI, buuuuut: This makes me think that
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah just verified, both fields can be set to true: I don't mind changing it to
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Interesting that https://github.com/temporalio/sdk-core/actions/runs/14725400139/job/41326870507?pr=909 passes and As for repeated, yeah, usually I would say show them all and let lang figure out how to handle, but I can also see that Core needs to pick an "interruption reason" winner. I may bring this up internally.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I don't think it's about "picking", per se, we may need to expose both all the way to the user
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, after discussion, it is the case that multiple booleans on this can be true (again there is a
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also after discussion, it should be known that "pause" can flip between true and false, so we may want to memoize its first true and not let it be set back to false, or maybe we are ok with the flipping.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This formatting does indeed seem weird, but don't know why CI isn't complaining. |
||
| cancels_tx | ||
| .send(PendingActivityCancel::new( | ||
| tt.clone(), | ||
| ActivityCancelReason::Cancelled, | ||
| reason, | ||
| )) | ||
| .expect( | ||
| "Receive half of heartbeat cancels not blocked", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You shouldn't need this I think. If it is necessary, see if we can find a way to avoid the sleep.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for other locations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I basically adapted this from
heartbeats_report_cancels_only_once, my guess was that the sleep was needed to wait for some heartbeat flush timeout to elapse. (if this is the case) I suppose we only need to flush this once for all heartbeats, instead of per heartbeat, now that I think about this more.Does the "general testing pattern" comment in the test line up accurately?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aaaah, right. Yeah... I suppose that's a bit unavoidable here. The comment makes sense.