Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-1151 deadlock during cluster failover
  3. JBAS-2569

Allow multiple threads to simultaneously invoke DistributedReplicantManagerImpl.notifyKeyListeners()

    XMLWordPrintable

Details

    Description

      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.

      Attachments

        Activity

          People

            bstansbe@redhat.com Brian Stansberry
            bstansbe@redhat.com Brian Stansberry
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1 day
                1d
                Remaining:
                Remaining Estimate - 1 day
                1d
                Logged:
                Time Spent - Not Specified
                Not Specified