You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2019/09/28 02:26:15 UTC
[GitHub] [rocketmq] vongosling commented on a change in pull request #1492:
[ISSUE 1491] Ignore IllegalStateException when remove shutdown hook
vongosling commented on a change in pull request #1492: [ISSUE 1491] Ignore IllegalStateException when remove shutdown hook
URL: https://github.com/apache/rocketmq/pull/1492#discussion_r329293046
##########
File path: client/src/main/java/org/apache/rocketmq/client/trace/AsyncTraceDispatcher.java
##########
@@ -216,7 +216,11 @@ public void run() {
public void removeShutdownHook() {
if (shutDownHook != null) {
- Runtime.getRuntime().removeShutdownHook(shutDownHook);
+ try {
+ Runtime.getRuntime().removeShutdownHook(shutDownHook);
+ } catch (IllegalStateException e) {
+ // ignore - VM is already shutting down
Review comment:
Do we really want to get rid of ShutdownHook?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services