Skip to content

fix(scheduling): release concurrency slots on account hydration errors - #73

Open
xiaoguai1818 wants to merge 1 commit into
CherryLover:mainfrom
xiaoguai1818:fix/scheduling-hydration-slot-release-20261117
Open

xiaoguai1818 wants to merge 1 commit into
CherryLover:mainfrom
xiaoguai1818:fix/scheduling-hydration-slot-release-20261117

Conversation

@xiaoguai1818

Copy link
Copy Markdown

Problem

When the Anthropic/Gemini scheduler acquires a concurrency slot and subsequent account hydration fails, newSelectionResult returns an error without a release callback, leaving the Redis slot occupied until TTL expiry.

Fix

Release the acquired slot before returning a hydration error. Successful hydration preserves the release callback for the caller.

Upstream

Selective backport of Wei-Shaw#8631 (commit 4ac713c); limited to the lite scheduling path and regression tests.

Local validation

  • go test -tags=unit ./internal/service -run TestGatewayServiceNewSelectionResult -count=10 — passed.
  • go build ./internal/service — passed.
  • git diff --check — passed.
  • Full service unit suite exceeded the 120s local execution limit; not counted as passing.

CI status

Draft pending GitHub target-repository CI and Security Scan for commit 66a6ba5. No merge, deployment, or release requested.

@xiaoguai1818
xiaoguai1818 marked this pull request as ready for review November 17, 2026 08:44
@xiaoguai1818

Copy link
Copy Markdown
Author

Final commit 66a6ba503ae19cca4e65c1f237d12cfa0ca2cb77 has passed all required target CI jobs (Go test, frontend, golangci-lint, shell) and both backend/frontend Security Scan jobs. Local focused regressions (10 repeats) and service build also passed; the separately attempted full local service suite hit its 120-second limit, so target CI is the complete validation evidence. PR is Ready for maintainer review; no merge or deployment has been performed.

xiaoguai1818 pushed a commit to xiaoguai1818/sub2api that referenced this pull request Nov 21, 2026
Record fork Actions HTTP 422 despite enabled API status, pending required CI/Security Scan, and overlapping existing lite PRs CherryLover#73-CherryLover#81. Do not claim the single consolidated PR is review-ready until the final SHA checks can actually run.
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