Skip to content

fix(scheduler): recover snapshot accounts after cooldown expiry - #8729

Merged
Wei-Shaw merged 2 commits into
Wei-Shaw:mainfrom
r266-tech:codex/snapshot-transient-expiry
Nov 16, 2026
Merged

Wei-Shaw merged 2 commits into
Wei-Shaw:mainfrom
r266-tech:codex/snapshot-transient-expiry

Conversation

@r266-tech

Copy link
Copy Markdown
Contributor

Closes #8709.

An account cooling down when a bucket is built is omitted until the next full rebuild, even after the block expires. Snapshot membership now uses the existing configured-account query; both cache hits and DB fallback apply Account.IsSchedulable when returning candidates. Rate-limit, overload and temporary-unschedulable expiry can therefore recover without a DB write, outbox event or rebuild.

The regression crosses each cooldown with virtual time and checks expiry revocation and manual/disabled accounts. PostgreSQL/Redis integration coverage exercises 18 combinations of platform, simple/group/ungrouped scope and forced/mixed routing, including deleted accounts and mixed-scheduling opt-in. Existing retirement/epoch tests use the configured-pool source.

Validation:

  • go test -p=2 -tags=unit ./...: passed.
  • Backend golangci-lint v2.14.0: 0 issues.
  • go test -p=2 -tags=integration -overlay <local-bootstrap.json> ./...: passed. The repository TestMain bootstrap used a fresh UTC PostgreSQL 16.15 database and Redis 8.10.2 in place of Docker; production code and test assertions were unmodified. All 18 new cases ran. Both suite runs retained their environment-gated skips.

AI-assisted implementation and local verification; no live provider or deployed gateway was used.

@Wei-Shaw
Wei-Shaw merged commit c6d9d48 into Wei-Shaw:main Nov 16, 2026
8 of 9 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] scheduler: an account stays out of the snapshot after its rate limit, overload or temp unschedulable block expires

2 participants