[GitHub] [tomcat] markt-asf commented on a change in pull request #379: Fix BZ 64080 - graceful close

2020-11-25 Thread GitBox


markt-asf commented on a change in pull request #379:
URL: https://github.com/apache/tomcat/pull/379#discussion_r530331565



##
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 waitMillisThe 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:
   Good suggestion. Fixed.





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



[GitHub] [tomcat] markt-asf commented on a change in pull request #379: Fix BZ 64080 - graceful close

2020-11-25 Thread GitBox


markt-asf commented on a change in pull request #379:
URL: https://github.com/apache/tomcat/pull/379#discussion_r530331336



##
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:
   Fixed. Tx for the review.





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