Skip to content
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

[Enhancement] InterruptedExceptions should never be ignored in the code.[EtcdMetaService] #4096

Closed
1 of 2 tasks
Alonexc opened this issue Jun 9, 2023 · 2 comments · Fixed by #4636
Closed
1 of 2 tasks
Labels
enhancement New feature or request good first issue Issues for first-time contributors

Comments

@Alonexc
Copy link
Contributor

Alonexc commented Jun 9, 2023

Search before asking

  • I had searched in the issues and found no similar issues.

Enhancement Request

image
image
located at:
eventmesh-registry-plugin/eventmesh-registry-etcd/src/main/java/org/apache/eventmesh/registry/etcd/service/EtcdRegistryService.java line 173,290
analysis and explanation:
InterruptedExceptions should never be ignored in the code, and simply logging the exception counts in this case as "ignoring". The throwing of the InterruptedException clears the interrupted state of the Thread, so if the exception is not handled properly the information that the thread was interrupted will be lost. Instead, InterruptedExceptions should either be rethrown - immediately or after cleaning up the method’s state - or the thread should be re-interrupted by calling Thread.interrupt() even if this is supposed to be a single-threaded application. Any other course of action risks delaying thread shutdown and loses the information that the thread was interrupted - probably without finishing its task.

Describe the solution you'd like

restore interrupted state
image
image

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
@Alonexc Alonexc added the enhancement New feature or request label Jun 9, 2023
@xwm1992 xwm1992 added the good first issue Issues for first-time contributors label Jun 15, 2023
@pandaapo pandaapo changed the title [Enhancement] InterruptedExceptions should never be ignored in the code.[EtcdRegistryService] Nov 22, 2023
@HarshSawarkar
Copy link
Contributor

Hi all, I have raised a PR for this issue.Can anyone please review it? Here's the link #4636

@HarshSawarkar
Copy link
Contributor

Also can someone please add me to ASF slack.Here's my email id: harshsawarkar111@gmail.com

xwm1992 pushed a commit that referenced this issue Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Issues for first-time contributors
3 participants