Fix thread-safety of connection pool map in ProxyHandler (#589)#589
Open
SamirFarhat17 wants to merge 1 commit intofacebookresearch:v2-betafrom
Open
Fix thread-safety of connection pool map in ProxyHandler (#589)#589SamirFarhat17 wants to merge 1 commit intofacebookresearch:v2-betafrom
SamirFarhat17 wants to merge 1 commit intofacebookresearch:v2-betafrom
Conversation
|
@SamirFarhat17 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D101637885. |
SamirFarhat17
added a commit
to SamirFarhat17/DCPerf
that referenced
this pull request
Apr 22, 2026
…earch#589) Summary: The static std::map in getBackendPool() is not thread-safe. With numIOThreads > 1, multiple IO threads call getBackendPool() concurrently, causing data races on pool creation. Replaces the unprotected static map with folly::Synchronized using a read/write lock pattern (rlock for fast-path lookup, wlock with double-check for pool creation). Differential Revision: D101637885
SamirFarhat17
added a commit
to SamirFarhat17/DCPerf
that referenced
this pull request
Apr 22, 2026
…earch#589) Summary: The static std::map in getBackendPool() is not thread-safe. With numIOThreads > 1, multiple IO threads call getBackendPool() concurrently, causing data races on pool creation. Replaces the unprotected static map with folly::Synchronized using a read/write lock pattern (rlock for fast-path lookup, wlock with double-check for pool creation). Differential Revision: D101637885
55e107a to
f4232f5
Compare
…earch#589) Summary: Pull Request resolved: facebookresearch#589 The static std::map in getBackendPool() is not thread-safe. With numIOThreads > 1, multiple IO threads call getBackendPool() concurrently, causing data races on pool creation. Replaces the unprotected static map with folly::Synchronized using a read/write lock pattern (rlock for fast-path lookup, wlock with double-check for pool creation). Differential Revision: D101637885
f4232f5 to
3f96a77
Compare
SamirFarhat17
added a commit
to SamirFarhat17/DCPerf
that referenced
this pull request
Apr 22, 2026
…earch#589) Summary: The static std::map in getBackendPool() is not thread-safe. With numIOThreads > 1, multiple IO threads call getBackendPool() concurrently, causing data races on pool creation. Replaces the unprotected static map with folly::Synchronized using a read/write lock pattern (rlock for fast-path lookup, wlock with double-check for pool creation). Differential Revision: D101637885
meta-codesync Bot
pushed a commit
that referenced
this pull request
Apr 23, 2026
Summary: Pull Request resolved: #589 The static std::map in getBackendPool() is not thread-safe. With numIOThreads > 1, multiple IO threads call getBackendPool() concurrently, causing data races on pool creation. Replaces the unprotected static map with folly::Synchronized using a read/write lock pattern (rlock for fast-path lookup, wlock with double-check for pool creation). Differential Revision: D101637885 fbshipit-source-id: 6738836ea98fc7740c0bf9176bcfd95b63e7b157
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.
Summary:
The static std::map in getBackendPool() is not thread-safe. With numIOThreads > 1,
multiple IO threads call getBackendPool() concurrently, causing data races on pool
creation. Replaces the unprotected static map with folly::Synchronized using a
read/write lock pattern (rlock for fast-path lookup, wlock with double-check for
pool creation).
Differential Revision: D101637885