tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 49497] New: Connector.pause() does not pause accepting request over keep-alive connections in Bio connector
Date Thu, 24 Jun 2010 12:15:36 GMT
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


Mime
View raw message