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 50107] New: StandardPipeline is destroyed two times.
Date Mon, 18 Oct 2010 07:05:48 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=50107

           Summary: StandardPipeline is destroyed two times.
           Product: Tomcat 7
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: mashmk02@gmail.com


Created an attachment (id=26181)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26181)
patch for MBeanFactory.java

When I call MBeanFactory#removeHost operation via JMX(jconsle), I get the
following message.

INFO: The destroy() method was called on component
[Pipeline[StandardHost[localhost]]] after destroy() had already been called.
The second call will be ignored.

StandardPipeline is destroyed two times.
At first, pipeline is destroyed at ContainerBase.java L.1096:
<<ContainerBase.java destroyInternal() L.1094-1097>>
   1094         // Stop the Valves in our pipeline (including the basic), if
any
   1095         if (pipeline instanceof Lifecycle) {
   1096             ((Lifecycle) pipeline).destroy();
   1097         }

<<ContainerBase.java destroyInternal() L.1104-1107>>
   1104         // Required if the child is destroyed directly.
   1105         if (parent != null) {
   1106             parent.removeChild(this);
   1107         }
When above-mentioned "parent" is StandardEngine, the parent.removeChild() calls
the  LifecycleBase#child.destroy(), and child.destroy() calls
ContainerBase#destroyInternal().
At this time ContainerBase is StandardHost.
<<ContainerBase.java removeChild() L.960-964>>
    960         // Set child's parent to null to prevent a loop
    961         child.setParent(null);
    962         try {
    963             child.destroy();
    964         } catch (LifecycleException e) {

As a result, pipeline is destroyed again(, and get the above-mentioned info
message).

In Tomcat 6.0, child.destroy() is not called from ContainerBase#removeChild().
But, as seen above, the removeChild() that is contained in Tomcat7.0 calls the
child.destroy().
IMHO, it might not be better to call the child.destroy() from removeHost().

I made the patch that removed host.destroy() from removeHost(). 

Best regards.

-- 
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