refactor: SentryReporter enabled guard, per-instance unmatched-secondary buffer, deterministic tests#363
Merged
Merged
Conversation
…struct, remove nolint, deterministic tests Co-authored-by: bootjp <1306365+bootjp@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add redis-proxy: dual-write Redis proxy with pub/sub forwarding
refactor: SentryReporter enabled guard, per-instance unmatched-secondary buffer, deterministic tests
Mar 20, 2026
Owner
|
@copilot fix golangci-lint |
Co-authored-by: bootjp <1306365+bootjp@users.noreply.github.com>
Contributor
Author
bootjp
approved these changes
Mar 20, 2026
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.
Four review fixes for the redis-proxy shadow pub/sub and Sentry reporter.
Changes
SentryReporter.ShouldReportenabled guard (sentry.go): Add earlyreturn falsewhen disabled, eliminating mutex acquisition and map churn on every secondary write when Sentry is not configured. Add injectablenowFuncto the struct.Per-instance
unmatchedSecondaries(shadow_pubsub.go): Remove the package-level globalsync.Mutex+map[*shadowPubSub]map[...]that serialized buffering/sweeping across all instances. Replaced with amap[msgKey][]secondaryPendingfield onshadowPubSubitself, protected by the existingsp.mu. Simplifies locking inmatchSecondary,reconcileWithBufferedSecondary,sweepExpired,sweepAll, andClose.Remove
//nolint:exhaustive(shadow_pubsub.go): Replace the two-branch switch inreportDivergencewith an explicitif d.kind == DivExtraDataso futureDivergenceKindadditions are caught at compile/lint time rather than silently falling to a default.Deterministic Sentry cooldown tests (
proxy_test.go):TestShouldReportCooldownandTestShouldReportEvictsExpiredpreviously usedtime.Sleepto wait out cooldown windows. Both now manipulate the injectednowFuncdirectly:🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.