Created attachment 33832 [details] 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
Thanks for the report and the patch. This has been fixed in the following versions: - 9.0.x for 9.0.0.M5 - 8.5.x for 8.5.1 - 8.0.x for 8.0.34 - 7.0.x for 7.0.70 - 6.0.x for 6.0.46