Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bound connection pool background dials to configured dial timeout #3089

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LINKIWI
Copy link
Contributor

@LINKIWI LINKIWI commented Aug 10, 2024

This PR is mildly related to #3088.

Callsites within the connection pool implementation that start asynchronous/background connection dials (for example, adding an idle connection to fulfill the required minimum idle connection count) currently use a background context for the dialer.

This has two problems:

  1. It can cause dial goroutines to have unbounded lifetime, subject only to the error behavior of the dialer implementation.
  2. Due to the bug described in Eliminate redundant dial mutex causing unbounded connection queue contention #3088, this callsite contends with other dialer invocations. In particular, this means that the background operation of adding a new idle connection can block critical-path connection acquisition.

This PR proposes threading the existing dial timeout through from top-level options to the connection pool, and using that value as a timeout bound on the asynchronous dial operation.

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