liubao68 commented on a change in pull request #693: [SCB-548] support
gracefully shutdown
URL:
https://github.com/apache/incubator-servicecomb-java-chassis/pull/693#discussion_r187825075
##########
File path:
core/src/main/java/org/apache/servicecomb/core/handler/ShutdownHookHandler.java
##########
@@ -39,13 +40,16 @@
private final AtomicLong responseCounter = new AtomicLong(0);
- private final int timeout = 600;
-
- private final int period = 10;
-
private volatile boolean shuttingDown = false;
+ public final Semaphore ALL_INVOCATION_FINISHED = new Semaphore(1);
+
private ShutdownHookHandler() {
+ try {
+ ALL_INVOCATION_FINISHED.acquire();
Review comment:
I think it's better to make semaphore private and add a method like
waitInvocationFinish. And in initialization, acquire is not required and
shutdownhook can be removed too.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services