You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2010/06/24 14:15:36 UTC

DO NOT REPLY [Bug 49497] New: Connector.pause() does not pause accepting request over keep-alive connections in Bio connector

https://issues.apache.org/bugzilla/show_bug.cgi?id=49497

           Summary: Connector.pause() does not pause accepting request
                    over keep-alive connections in Bio connector
           Product: Tomcat 6
           Version: 6.0.26
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Connectors
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: knst.kolinko@gmail.com


When Tomcat performs shutdown, it pauses its connectors, then all web
applications, and then stops the connectors.

In my understanding, pause() should stop Tomcat from accepting new requests
from clients,  to give it time to complete requests that are currently being
processed. The stop() call will close the sockets, and thus will abort request
processing.


The problem is that the default (aka Bio) HTTP/1.1 connector of TC 6.0 behaves
differently: when endpoint is paused, connector stops to accept new
connections, but it still continues to accept new requests over existing
keep-alive connections. I think it is not a feature, but a bug.

To reproduce:
1. Start Tomcat
2. Open http://localhost:8080/ in Firefox
3. Start jconsole, connect to Tomcat, select MBean for the Connector on port
8080 and invoke its pause() method.
4. Actual behaviour: In Firefox you can still open other pages of the web site,
in spite of Connector being paused.

This issue does not affect Apr and Nio HTTP/1.1 connectors. In their case an
attempt to navigate to another page of the site results in browser waiting for
response from Tomcat.


To fix it, one has to modify the loop in Http11Processor#process() to check for
the current value of endpoint.isPaused().

Caveat/separate issue: when the current Apr/Nio implementations are paused,
they stop accepting the requests, but the keep-alive connection is still kept
open. Maybe they should close the connection? On second thought, though, it
makes a difference only if there is some load balancer in front of several
Tomcats. Otherwise closing the connection will be just annoying, because a user
will be tempted to immediately repeat the request, but Tomcat instance is still
paused and will not be able to process it.

Tested with 6.0.27, WinXP, Firefox 3.6.4.

This bug report was inspired by the following comment in
StandardService.stop():
// FIXME pero -- Why container stop first? KeepAlive connetions can send
request!

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 49497] Connector.pause() does not pause accepting request over keep-alive connections in Bio connector

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49497

--- Comment #1 from Mark Thomas <ma...@apache.org> 2010-09-28 07:53:16 EDT ---
Created an attachment (id=26094)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26094)
Proposed patch

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 49497] Connector.pause() does not pause accepting request over keep-alive connections in Bio connector

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49497

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #2 from Mark Thomas <ma...@apache.org> 2010-11-03 15:03:16 UTC ---
Fixed in 6.0.x and will be included in 6.0.30 onwards.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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