-
Sub-task
-
Resolution: Done
-
Major
-
JBossAS-4.0.2 Final, JBossAS-4.0.3 Final, JBossAS-4.0.3 SP1
-
None
In 4.0.3SP1 and earlier, a large synchronized block inside DistributedReplicantManagerImpl.notifyKeyListeners() effectively caused the method to behave as if it itself was synchronized. With the fix to JBAS-2539, the synchronized block has been removed, but to avoid changing the behavior of the DRM, the method itself was made synchronized.
This synchronization will cause the kind of deadlock reported in the parent issue JBAS-1151 and needs to be removed. The deadlock can occur if a deployment is occuring on a cluster node and at the same time a failover occurs that results in the node becoming the master. The HASingletonDeployer service will also begin deploying services from within a call from DistributedReplicantManagerImpl.notifyKeyListeners(), and the deadlock shown in JBAS-1151 will occur.
In order the synchronized token from the method, the various listeners need to be checked for thread safety, and if any have issues they need to be corrected. Most likely this will mean making their replicantsChanged() method synchronized.
Their is already a unit test in DRMTestCase for the deadlock issue described above.