martin-g commented on a change in pull request #379:
URL: https://github.com/apache/tomcat/pull/379#discussion_r530317113



##########
File path: java/org/apache/tomcat/util/net/AbstractEndpoint.java
##########
@@ -1302,6 +1320,16 @@ protected long countDownConnection() {
      */
     public final void closeServerSocketGraceful() {
         if (bindState == BindState.BOUND_ON_START) {
+            // Stop accepting new connections
+            acceptor.stop(-1);
+            // Release locks that may be preventing the acceptor from stopping
+            releaseConnectionLatch();
+            unlockAccept();
+            // Signal to any multiplexed protocols (HTTP/2) that they may wish
+            // to stop accepting new streams
+            getHandler().pause();
+            // Update the bindSatte. This has the side-effect of disabling

Review comment:
       s/bindSatte/bindState/

##########
File path: java/org/apache/tomcat/util/net/AbstractEndpoint.java
##########
@@ -1312,6 +1340,30 @@ public final void closeServerSocketGraceful() {
     }
 
 
+    /**
+     * Wait for the client connections to the server to close gracefully. The
+     * method will return when all of the client connections have closed or the
+     * method has been waiting for {@code waitTimeMillis}.
+     *
+     * @param waitMillis    The maximum time to wait in milliseconds for the
+     *                      client connections to close.
+     *
+     * @return The wait time, if any remaining when the method returned
+     */
+    public final long closeConnectionsAwait(long waitMillis) {

Review comment:
       Maybe the method name should be `awaitConnectionsClose` ?
   Now it sounds like it closes and waits, but actually it just waits.




----------------------------------------------------------------
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:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to