fix(scheduler): reclaim orphaned thread claims (unblock prod hot-loop, fixes #1559)#1563
Open
bingran-you wants to merge 1 commit intodevfrom
Open
fix(scheduler): reclaim orphaned thread claims (unblock prod hot-loop, fixes #1559)#1563bingran-you wants to merge 1 commit intodevfrom
bingran-you wants to merge 1 commit intodevfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
c1792f8 "Reclaim orphaned scheduler thread claims"onto latestdevas a narrow, conflict-free PR.reason=thread busybecause the in-memoryrunning_threadsHashMap has stale claims with no matchingtask_executionsrunning row.CONFLICTINGagainstdev; this PR is a clean-cut subset so the reliability fix can land without waiting on the ACI-delete-timeout review.Why this is urgent
Prod (commit
214cfd9) has been wedged since 2026-04-23 01:08 UTC. Two concrete user-facing impacts:shuangshuang329@gmail.com(taskb0359ed4) stuck ≈28h.1441903771@qq.com(EAP essay, task35b9d323) stuck ≈4h.Plus 33 other deferred-but-never-executed tasks across 15+ users.
What the patch does
scheduler_module/src/service/scheduler.rs:try_reclaim_orphaned_thread_claimthat, when a claim is refused as "thread busy", checks whether the claim's task has any matchingrunningrow intask_executions. If not, the entry is dropped fromrunning_threadsand the slot is reclaimed.claim_thread_execution_slotso the hot-loop self-heals within a tick instead of wedging forever.Test plan
cargo build -p scheduler_module --releasegreenfound N due task(s)followed byexecuting(notdeferred) for most tasks within one ticktask_executionsrunning count on prod return to near-zero once legitimate ACI runs finishFollow-ups (not part of this PR)