https://bz.apache.org/bugzilla/show_bug.cgi?id=59449

            Bug ID: 59449
           Summary: org.apache.catalina.core.ContainerBase#removeChild
                    remove order
           Product: Tomcat 9
           Version: 9.0.0.M4
          Hardware: PC
                OS: Mac OS X 10.1
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: huxing.zh...@gmail.com

Created attachment 33832
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=33832&action=edit
patch to implement the proposed behaviour.

Hi, 

In org.apache.catalina.core.ContainerBase#addChildInternal,  we have the
following execution order:

1. put child to children
2. call child' start
3. fire ADD_CHILD_EVENT

However, in org.apache.catalina.core.ContainerBase#removeChild, the execution
order is not in reverse order:

1. remove child from children
2. call child's stop
3. fire REMOVE_CHILD_EVENT
4. call child's destroy if necessary 

This may lead to some unexpected behaviour. e.g. One can deploy a web app while
it is being undeployed.

Proposed execution order  in removeChild:

1. call child's stop
2. call child's destroy if necessary 
3. remove child from children
4. fire REMOVE_CHILD_EVENT

-- 
You are receiving this mail because:
You are the assignee for the bug.

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

Reply via email to