temporalio / temporalio/sdk-rust
[Bug] Worker task slots used/available off-by-one error
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 523
- Forks
- 161
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 67
Description
It's sometimes possible for, after fully completing a workflow, for WFT used metric to bet @ 1 and available @ the max still. Possibly also available may be at the max even before an evict is fully complete.
I think this maybe has to do with the special bit of code here https://github.com/temporalio/sdk-core/blob/95db75dc950cf07a99c79e6794172572dd34e6a6/core/src/abstractions.rs#L128 that needs to add one extra sometimes
Additionally slots are released before eviction completes, but we probably don't want that. We should hold on to the permit until eviction is complete, for situations where we had a permit when we generated the eviction.
Contributor guide
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 with core/src/abstractions.rs at the linked line, then trace worker task-slot permit release and eviction handling. Reproduce workflow completion and eviction scenarios, and verify that used and available metrics remain consistent and permits are held until eviction completes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend, distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100