Skip to content

Free a Worker slot while a Turn waits for function results - #965

Merged
SaladDay merged 1 commit into
mainfrom
free-worker-slot-while-waiting
Nov 12, 2026
Merged

SaladDay merged 1 commit into
mainfrom
free-worker-slot-while-waiting

Conversation

@SaladDay

@SaladDay SaladDay commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

A Turn in waiting kept its OAC_EXECUTION_CONCURRENCY slot until the application answered. With the default of 4, four unanswered function calls stopped all hosted execution in Core, for every provider and Harness.

  • The delivery loop reports whether its Turn waits for function results. The Session stays reserved (no other work runs on it), but the Worker counts only the remaining Sessions against the limit.
  • A resumed Turn takes its slot back, so execution.slots_in_use can briefly exceed slots_total; documented in Core metrics (English and Chinese).
  • Turn completions no longer rely on a buffer sized to the limit: more Turns than the limit can now be alive.

Test: TestWorkerWaitingTurnHoldsNoExecutionSlot — with concurrency 1, a waiting Turn no longer blocks another Session's Turn (fails on main with a read timeout).


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@SaladDay
SaladDay enabled auto-merge (squash) November 12, 2026 06:38
A Turn in waiting kept its OAC_EXECUTION_CONCURRENCY slot until the
application answered, so as many unanswered questions as slots stopped
all hosted execution. The delivery loop now reports whether its Turn
waits; the Session stays reserved, but the Worker counts only the other
Sessions against the limit.
@SaladDay
SaladDay merged commit c05af21 into main Nov 12, 2026
19 checks passed
@SaladDay
SaladDay deleted the free-worker-slot-while-waiting branch November 12, 2026 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant