"' is not unique");
child.setParent(this); // May throw IAE
children.put(child.getName(), child);
+ }
- // Start child
- if ((getState().isAvailable() ||
- LifecycleState.STARTING_PREP.equals(getState())) &&
- startChildren) {
- boolean success = false;
- try {
- child.start();
- success = true;
- } catch (LifecycleException e) {
- log.error("ContainerBase.addChild: start: ", e);
- throw new IllegalStateException
- ("ContainerBase.addChild: start: " + e);
- } finally {
- if (!success) {
+ // Start child
+ // Don't do this inside sync block - start can be a slow process and
+ // locking the children object can cause problems elsewhere
+ if ((getState().isAvailable() ||
+ LifecycleState.STARTING_PREP.equals(getState())) &&
+ startChildren) {
+ boolean success = false;
+ try {
+ child.start();
+ success = true;
+ } catch (LifecycleException e) {
+ log.error("ContainerBase.addChild: start: ", e);
+ throw new IllegalStateException
+ ("ContainerBase.addChild: start: " + e);
+ } finally {
+ if (!success) {
+ synchronized (children) {
children.remove(child.getName());
}
}
}
-
- fireContainerEvent(ADD_CHILD_EVENT, child);
}
+ fireContainerEvent(ADD_CHILD_EVENT, child);
}
if (name == null)
return (null);
- synchronized (children) { // Required by post-start changes
+ synchronized (children) {
return children.get(name);
}
Reduce synchronization in session managers to improve performance of
session creation. (markt)
</add>
+ <fix>
+ If starting children automatically when adding them to a container (e.g.
+ when adding a Context to a Host) don't lock the parent's set
+ of children whilst the new child is being started since this can block
+ other threads and cause issues such as lost cluster messages. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
send options to be set for the reply message. Based on a patch by Ariel.
(markt)
</fix>
+ <fix>
+ Ensure that a new Context waiting for session data from other nodes in
+ the cluster does not block the processing of clustering messages for
+ other Contexts. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Web applications">