Skip to content

pool: bound New connect by context, add WaitConnected#592

Open
bigbes wants to merge 1 commit into
masterfrom
bigbes/gh-no-rewrite-pool-new
Open

pool: bound New connect by context, add WaitConnected#592
bigbes wants to merge 1 commit into
masterfrom
bigbes/gh-no-rewrite-pool-new

Conversation

@bigbes
Copy link
Copy Markdown
Collaborator

@bigbes bigbes commented May 12, 2026

pool.New / pool.NewWithOpts no longer use Opts.CheckTimeout to bound the initial connect: they dial all instances concurrently and wait for those dials to finish, bounded only by the supplied context. Previously the wait was additionally capped at CheckTimeout after the first successful dial. Opts.CheckTimeout now only drives the reconnect and role-relocate timer.

Add Pool.WaitConnected(ctx, mode) (also on the Pooler interface) to block until a connection in the given mode is ready, since New may return a pool with no live connections when instances are unreachable.

@bigbes bigbes marked this pull request as draft May 12, 2026 22:33
pool.New / pool.NewWithOpts no longer use Opts.CheckTimeout to bound the
initial connect: they dial all instances concurrently and wait for those
dials to finish, bounded only by the supplied context. Previously the
wait was additionally capped at CheckTimeout after the first successful
dial. Opts.CheckTimeout now only drives the reconnect and role-relocate
timer.

Add Pool.WaitConnected(ctx, mode) (also on the Pooler interface) to
block until a connection in the given mode is ready, since New may
return a pool with no live connections when instances are unreachable.
@bigbes bigbes force-pushed the bigbes/gh-no-rewrite-pool-new branch from 1c39288 to 6fcd412 Compare May 12, 2026 22:38
@bigbes bigbes marked this pull request as ready for review May 12, 2026 22:47
@bigbes bigbes requested a review from oleg-jukovec May 13, 2026 10:04
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