temporalio / temporalio/sdk-rust

[Bug] Worker task slots used/available off-by-one error

Open
#894 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.