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

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

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
rust

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.

Description

bug

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.

Dominant language
Rust
Stars
542
Forks
172
Avg merge
2d 4h
Merged PRs (30d)
53

Getting set up

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.

More from temporalio/sdk-rust

All issues in temporalio/sdk-rust

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.