Skip to content

GODRIVER-3419 Use a semaphore to limit concurrent conn creation #2098

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

prestonvasquez
Copy link
Member

@prestonvasquez prestonvasquez commented Jun 12, 2025

GODRIVER-3419

Summary

This PR refactors the connection pool to eliminate the persistent maxConnection goroutines spawns at pool construction. Here we adopt a more lightweight, on-demand model inspired by @matthewdale's POC c26a3cb. Each new goroutine is responsible for creating exactly one connection and then terminates immediately.

Background & Motivation

While so-far not reproducible locally, the "spawn-and-done" approach suggested by this PR intends to avoid any long-term memory allocation patterns causing the GC to thrash. See ticket for more information.

@prestonvasquez prestonvasquez requested a review from a team as a code owner June 12, 2025 01:41
@prestonvasquez prestonvasquez marked this pull request as draft June 12, 2025 01:41
@mongodb-drivers-pr-bot mongodb-drivers-pr-bot bot added the priority-3-low Low Priority PR for Review label Jun 12, 2025
Copy link
Contributor

API Change Report

No changes found!

@prestonvasquez prestonvasquez marked this pull request as ready for review June 13, 2025 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority-3-low Low Priority PR for Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant