fix(ssh): cap consecutive connection failures COMPASS-10804 - #8211
Merged
Conversation
Picks up the fix for COMPASS-10804: concurrent SSH reinit attempts were racing to each create a new ssh2 client, leaving N-1 orphaned server-side sessions per MongoDB driver retry cycle. After a machine hibernate, sessions accumulated unboundedly until the bastion ran out of RAM. The fix serializes concurrent reinit via `reinitializingPromise` and stops retrying after 3 consecutive failures (`closed = true`).
mabaasit
approved these changes
Jul 6, 2026
Collaborator
|
This should be a fix instead of a chore, with a proper title to highlight ssh issue |
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.
Description
Bumps
@mongodb-js/devtools-proxy-supportfrom^0.7.15to^0.7.17across all packages that depend on it, picking up the SSH session leak fix from devtools-shared#809.Checklist
Motivation and Context
Fixes COMPASS-10804: when a machine hibernates and resumes, the MongoDB driver retries heartbeat connections concurrently. Without the fix, each concurrent
_connect()caller bypassed theconnectingPromisededuplication guard and raced throughinitialize(reinitializeClient=true), each creating a new ssh2 client and a new server-side SSH session. N-1 of these were immediately orphaned per retry cycle, accumulating unboundedly until the bastion ran out of RAM (customers reported 300+ dangling sessions within hours).The fix in devtools-proxy-support 0.7.17 serializes concurrent reinit attempts via
reinitializingPromiseso only one new ssh2 client is created per cycle, and stops retrying entirely after 3 consecutive failures (closed = true).Open Questions
None.
Dependents
Depends on: mongodb-js/devtools-shared#809
Types of changes