-
Notifications
You must be signed in to change notification settings - Fork 183
chore: improve concurrency around block node connection closing #21247
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
Conversation
Signed-off-by: Tim Farber-Newman <[email protected]>
Signed-off-by: Tim Farber-Newman <[email protected]>
Signed-off-by: Tim Farber-Newman <[email protected]>
Signed-off-by: Tim Farber-Newman <[email protected]>
Signed-off-by: Tim Farber-Newman <[email protected]>
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) |
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
Codecov Report❌ Patch coverage is @@ Coverage Diff @@
## main #21247 +/- ##
============================================
- Coverage 71.27% 71.04% -0.24%
- Complexity 24229 24237 +8
============================================
Files 2669 2673 +4
Lines 103461 103812 +351
Branches 10771 10803 +32
============================================
+ Hits 73742 73753 +11
- Misses 25675 26014 +339
- Partials 4044 4045 +1
... and 44 files with indirect coverage changes 🚀 New features to boost your workflow:
|
.../hedera-app/src/main/java/com/hedera/node/app/blocks/impl/streaming/BlockNodeConnection.java
Outdated
Show resolved
Hide resolved
.../hedera-app/src/main/java/com/hedera/node/app/blocks/impl/streaming/BlockNodeConnection.java
Show resolved
Hide resolved
...-app/src/main/java/com/hedera/node/app/blocks/impl/streaming/BlockNodeConnectionManager.java
Show resolved
Hide resolved
Signed-off-by: Tim Farber-Newman <[email protected]>
Signed-off-by: Tim Farber-Newman <[email protected]>
derektriley
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks @timfn-hg
Signed-off-by: Tim Farber-Newman <[email protected]>
Description:
These changes try to improve handling of concurrent close operations on a block node connection and the almost unavoidable race conditions associated with it. A new state (CLOSING) is introduced to signal that a connection is in the process of closing and more fine grain checks and controls related to closing are implemented.
Additionally, a new check is added when sending a request to a block node such that if/when a race condition is encountered when a connection is being closed by one thread while another thread is trying to send a request over the same connection, we will ignore any errors that happen if the connection is not in an active state.
Also introduced is a connection ID that is unique to each connection instance. This makes it much easier to group together logs for an individual connection instance, especially when one or more connections are inflight to the same host (e.g. testing locally with multiple BN connections all to localhost.)
Related issue(s):
Fixes #21241
Notes for reviewer:
Checklist