fix(scheduler): atomic-read counters in control loop#26
Merged
Conversation
control() reads countIncomingReqs and countProcessedReqs with plain loads while worker goroutines (and PublishRequest) update them via atomic.AddInt64. Under the race detector this consistently trips a data-race warning — surfaced downstream in singchia/geminio's race CI. Snapshot each counter with a single atomic.LoadInt64 so both the diff and the baseline update see the same value, and no plain read races with a concurrent atomic write. No behavioral change on non-race builds. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
singchia
added a commit
to singchia/geminio
that referenced
this pull request
Apr 24, 2026
Picks up the scheduler counter-race fix (singchia/go-timer#26) so gemino's -race CI stays clean without waiting on flake retries.
singchia
added a commit
to singchia/geminio
that referenced
this pull request
Apr 24, 2026
* rename: geminio → gemino across module, package, brand, and assets Renames the module to github.com/singchia/gemino, the top-level package to `gemino`, and every `Geminio` / `geminio` mention in prose, examples, docs, and tests. geminio.go → gemino.go and docs/geminio.png → docs/gemino.png. No logic changes; all tests green under the new path (unit, integration, e2e, chaos, regression, security, harness). After this merges, the GitHub repo needs to be renamed singchia/geminio → singchia/gemino (web settings). Old tags v1.0 … v1.3.0-rc.1 remain indexed on the Go proxy under the old module path and keep working for existing consumers; new tags under the new path resume at v1.3.0-rc.2. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * make: wire up bench target and expand test coverage - Top-level: \`make bench\` now actually runs the benchmark suite (README has been pointing at it for a while). - \`make test\` no longer means just regression — it runs every suite under test/ (unit, integration, regression, e2e, security, harness, chaos). Each target gets an explicit timeout so a hang surfaces fast. Local on Apple M4: make test ~3m14s, make bench ~1m49s. All green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore: re-trigger CI after rename race-detector flake * deps: bump singchia/go-timer/v2 to v2.2.2 Picks up the scheduler counter-race fix (singchia/go-timer#26) so gemino's -race CI stays clean without waiting on flake retries. --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
control()readscountIncomingReqsandcountProcessedReqswith plain loads, but worker goroutines andPublishRequestupdate them viaatomic.AddInt64. Under the Go race detector this consistently trips a data-race warning — surfaced insingchia/geminio's race-enabled CI jobs.Fix
Snapshot each counter with a single
atomic.LoadInt64so the diff and the baseline update see the same value, and no plain read races with a concurrent atomic write.countIncomingReqsL/countProcessedReqsLare only touched bycontrol()itself, so they stay plain.Test plan
go test -race ./...in this repo — cleango test -race ./test/integration/...in singchia/geminio with a localreplacepointing at this branch — clean (previously raced)Impact
🤖 Generated with Claude Code