Fix start-to-close timeout failure caused by short heatbeat timeout#1300
Merged
Conversation
- start_to_close_timeout < heartbeat_timeout - neither timeout
chris-olszewski
requested changes
May 28, 2026
Member
chris-olszewski
left a comment
There was a problem hiding this comment.
Haven't fully reviewed, but pretty concerned about the integration test being flakey.
chris-olszewski
approved these changes
May 28, 2026
Member
chris-olszewski
left a comment
There was a problem hiding this comment.
LGTM, very minor suggestions
Co-authored-by: Chris Olszewski <chrisdolszewski@gmail.com>
Co-authored-by: Chris Olszewski <chrisdolszewski@gmail.com>
Co-authored-by: Chris Olszewski <chrisdolszewski@gmail.com>
Co-authored-by: Chris Olszewski <chrisdolszewski@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When an activity has both startToCloseTimeout and heartbeatTimeout set, and heartbeatTimeout < startToCloseTimeout, the Core SDK's local timeout timer never fires because successful heartbeats keep resetting it. The activity runs indefinitely on the worker even after the server has timed it out.
The previous implementation simply ignored the start_to_close timeout when the heartbeat timeout was shorter, which would work if the heartbeat timeout was not reset after each heartbeat ack. Instead, the heartbeat acks kept the activity alive long after the server had hit the start-to-close timeout. The workflow correctly resolved with a timeout, but the activity kept running and occupying a worker task slot.
The fix is to run both timeouts together -- the one-time start_to_close timeout and the infinitely resettable heartbeat timeout.
Tests: 3 unit, 1 integration.
Fixes #1188