-
Notifications
You must be signed in to change notification settings - Fork 594
HDDS-14454. Improve XceiverClientGrpc shutdown logic to ensure proper channel termination #9717
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
base: master
Are you sure you want to change the base?
Conversation
… channel termination.
a2dd999 to
af22ced
Compare
…channel termination handling.
| try { | ||
| channel.awaitTermination(60, TimeUnit.MINUTES); | ||
| if (!nonTerminatedChannels.isEmpty()) { | ||
| ManagedChannel channel = nonTerminatedChannels.get(0); |
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.
why not just sleep?
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.
This was due to the presence of synchronized methods and to workaround findbugs error
Run if [[ -s "target/$SCRIPT/summary.md" ]]; then
M M SWL: org.apache.hadoop.hdds.scm.XceiverClientGrpc.close() calls Thread.sleep() with a lock held At XceiverClientGrpc.java:[line 258]
Error: Process completed with exit code 1.
| * to finish ongoing communication, then interrupts the connection anyway. | ||
| */ | ||
| @Override | ||
| public synchronized void close() { |
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.
with shutdown() instead of shutdownNow() we should not need synchronized here
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.
we should use concurrent maps here, it should help with removing synchronized methods.
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.
The follow up PR #9718 addresses methods other than close
…cleaner channel termination handling." This reverts commit 7b6b0ee.
…onized modifier from close method.
yandrey321
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
|
Hi @jojochuang, could you please review this? |
What changes were proposed in this pull request?
This change improves the closing mechanism for the Grpc client.
It closes all channels at the same time.
It waits only 5 seconds for closing the channels
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-14454
How was this patch tested?
CI: https://github.com/ptlrs/ozone/actions/runs/21736799049