You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by GitBox <gi...@apache.org> on 2020/11/24 10:26:31 UTC
[GitHub] [tomcat] markt-asf opened a new pull request #379: Fix BZ 64080 - graceful close
markt-asf opened a new pull request #379:
URL: https://github.com/apache/tomcat/pull/379
Fixes https://bz.apache.org/bugzilla/show_bug.cgi?id=64080
Doing this via a PR to give folks a chance to review the changes first
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[GitHub] [tomcat] martin-g commented on a change in pull request #379: Fix BZ 64080 - graceful close
Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[GitHub] [tomcat] markt-asf commented on a change in pull request #379: Fix BZ 64080 - graceful close
Posted by GitBox <gi...@apache.org>.
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 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:
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[GitHub] [tomcat] rmaucher commented on pull request #379: Fix BZ 64080 - graceful close
Posted by GitBox <gi...@apache.org>.
rmaucher commented on pull request #379:
URL: https://github.com/apache/tomcat/pull/379#issuecomment-733693070
Looks ok, at least I can't see right now why it would be bad.
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[GitHub] [tomcat] markt-asf closed pull request #379: Fix BZ 64080 - graceful close
Posted by GitBox <gi...@apache.org>.
markt-asf closed pull request #379:
URL: https://github.com/apache/tomcat/pull/379
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[GitHub] [tomcat] markt-asf commented on a change in pull request #379: Fix BZ 64080 - graceful close
Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org