sdk-core icon indicating copy to clipboard operation
sdk-core copied to clipboard

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

Open Sushisource opened this issue 9 months ago • 0 comments

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.

Sushisource avatar Mar 27 '25 21:03 Sushisource