Conversation
ivanauth
force-pushed
the
fix/crdbpool-issue-8-replace-jitterbug
branch
from
February 10, 2026 18:53
93dadbe to
2081927
Compare
The jitterbug ticker was configured as Uniform{Min: interval} against a
base interval of the same length. jitterbug computes the delay as
max(rand.Int63n(interval), Min), and the draw is always less than
interval, so every "jittered" poll fired at exactly the interval. Health
checks had no jitter at all.
Poll now uses a reusable time.Timer, which also avoids allocating a new
channel on every tick, and jitteredInterval offsets each tick by a
uniformly random amount in [-interval/2, +interval/2). The distribution
is centered on the requested interval and is covered by a unit test. A
non-positive interval now disables polling instead of panicking in
rand.Int63n.
Dropping the dependency required updating the toolchain: govulncheck
reported 13 vulnerabilities across the Go standard library,
google.golang.org/grpc, golang.org/x/text and github.com/jackc/pgx/v5.
CI moves to Go ~1.26.5, grpc to v1.82.1, x/text to v0.39.0 and pgx to
v5.9.2, which clears all of them. go mod tidy raises the module's Go
directive to 1.25.0, so the magefiles workspace is bumped to match.
pgx v5.9.2 deprecates pgxpool BeforeAcquire in favor of PrepareConn, and
PrepareConn takes precedence when both are set, so the wrapper now
installs PrepareConn while still honoring a caller-supplied
BeforeAcquire as a fallback.
Fixes authzed#8
ivanauth
force-pushed
the
fix/crdbpool-issue-8-replace-jitterbug
branch
from
July 28, 2026 15:24
ed38f7f to
b7d0829
Compare
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.
Replaces the
jitterbugdependency with stdlibtime.After+math/randfor health check poll jitter.Fixes #8