Bug 49802 - Shutdown of AJP Connector do not work
Summary: Shutdown of AJP Connector do not work
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Connectors (show other bugs)
Version: 7.0.2
Hardware: PC Linux
: P2 regression (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2010-08-23 05:59 UTC by Domenico Briganti
Modified: 2010-09-05 16:37 UTC (History)
0 users

Catalina log (8.35 KB, application/octet-stream)
2010-08-23 05:59 UTC, Domenico Briganti

Note You need to log in before you can comment on or make changes to this bug.
Description Domenico Briganti 2010-08-23 05:59:48 UTC
Created attachment 25927 [details]
Catalina log

  when Tomcat is under load from an Apache httpd server (through mod_jk and ajp13) and I shutdown it, I get NullPointerException:

23-ago-2010 11.06.47 org.apache.coyote.http11.AbstractHttp11Protocol pause
INFO: Pausing Coyote HTTP/1.1 on http-9080
23-ago-2010 11.06.47 org.apache.coyote.ajp.AjpProtocol pause
INFO: Pausing Coyote AJP/1.3 on ajp-9009
23-ago-2010 11.06.48 org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
23-ago-2010 11.06.48 org.apache.catalina.connector.CoyoteAdapter service
GRAVE: An exception or error occurred in the container during the request processing
        at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:638)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:397)
        at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:450)
        at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:385)

I think the stopping of the Coyote AJP Connector doesn't work. In fact, if you go with jconsole on MBean Catalina->Connector->8009 and do "Stop" on "operation tab", nothing happens.

To reproduce this bug:
 * Download Tomcat 7.0.2 
 * Confingure an Apache httpd with a JkMount /examples/*
 * Use ab to generate request (ex:  ab -c 3 -n 1000000 "http://localhost/examples/jsp/jsp2/el/basic-arithmetic.jsp")

Thank you,
 Domenico Briganti
Comment 1 Mark Thomas 2010-08-30 19:14:43 UTC
The NPE you are seeing is a side-effect. The root cause is bug 49497.

JMX not having any obvious affect is a separate bug. The connector is stopped (the state changes) but nothing is logged and it will continue to work since there is a mis-match in the state transitions between the Connector and the underlying ProtocolHandler.

I have a patch for the start/stop issue but I want to take a closer look at the Connector & ProtocolHandler life-cycles to see if I can align them.
Comment 2 Mark Thomas 2010-09-05 16:37:41 UTC
This bug has been fixed in 7.0.x and will be included in 7.0.3 onwards.

Note: There is scope for further re-factoring to align the protocols and the endpoints with the new life-cycle code in 7.0.x.