temporalio / temporalio/features
[Feature Request] Schedule timers even if duration is <= 0
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 32
- Forks
- 28
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 7
Description
Our SDKs have inconsistent behavior when a timer with duration <= 0 is scheduled.
- Server expects duration to be > 0 and fails the workflow task otherwise.
- Python will throw if duration is negative: https://github.com/temporalio/sdk-python/blob/1f72c982aa6153ac5b50efb1ee2248e18d9af083/temporalio/worker/_workflow_instance.py#L1326
- TypeScript will apply minimum of 1.
- Java and Go do not schedule a timer at all.
Ideally, the server should allow duration 0 to avoid special handling and mutation of user input on the SDK.
SDKs should ideally always schedule the timer to avoid triggering the non-determinism checker if timer duration is changed on replay, this can probably be achieved in Go and Java in a backwards compatible manner.
See also:
https://github.com/temporalio/sdk-java/issues/1579
https://github.com/temporalio/features/issues/378
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the SDK behaviors described in the issue, beginning with Python's temporalio/worker/_workflow_instance.py around line 1326, and review the linked Java and features issues. Define the compatibility requirements for zero and negative durations across the server and SDKs; done means the behavior is consistent without introducing replay non-determinism.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, java, python, typescript
- Domain
- distributed-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100