fix: Remove RpcOverloadMonitor race condition - #26827
Open
abies wants to merge 1 commit into
Open
Conversation
Signed-off-by: Artur Biesiadowski <artur.biesiadowski@swirldslabs.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #26827 +/- ##
=========================================
Coverage 70.44% 70.44%
+ Complexity 11662 11661 -1
=========================================
Files 2583 2583
Lines 108274 108274
Branches 12110 12110
=========================================
+ Hits 76274 76278 +4
- Misses 28017 28020 +3
+ Partials 3983 3976 -7
... and 12 files with indirect coverage changes 🚀 New features to boost your workflow:
|
✅ All tests passed ✅🏷️ Commit: 436f90a Learn more about TestLens at testlens.app. |
poulok
reviewed
Aug 14, 2026
| // we are still reporting delay to receive, not to handle | ||
| // we want to measure the network ping, rather than dispatch thread ping | ||
| // it is still handled over there, to make overloadMonitor managed from same thread | ||
| inputQueue.add(() -> overloadMonitor.reportPing(pingMillis)); |
Contributor
There was a problem hiding this comment.
I know at one point, we had performance problems that were traced back to the creation of too many lambda objects. I don't know if it is still something we need to be careful with. Is there a way to solve the problem with the lambdas?
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:
Given that RpcOverloadMonitor was updated from two different threads, even in the presence of volatiles, there could be a strange ordering of updates, which would lead to a delayed reaction to overload or going out of overload.
This change simplifies handling, as everything will be done from the same (dispatch) thread.
Related issue(s):
Fixes #26762
Checklist