Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-7945

LookupSucceededFilter is not thread safe

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 6.0.0.M3
    • JBossAS-5.1.0.CR1, JBossAS-5.1.0.GA, 6.0.0.M2
    • Clustering
    • None

    Description

      Access to the private boolean lookupSucceeded field is not controlled.

      It should be volatile with an initial false value and only set to true when an acceptable result is received. The only state change is to true.

      TruthfulResponseFilterUnitTestCase is intermittently failing, probably for the same reason. Here is the logging it generates when it fails: threads OOB-16 and OOB-15 are concurrently executing in the isAcceptableMethod().

      2010-04-14 19:42:15,188 DEBUG [org.jboss.test.cluster.rspfilter.Echo] (RMI TCP Connection(70)-10.16.93.33) callEchoOnCluster(true, false, org.jboss.test.cluster.rspfilter.TruthfulResponseFilter@34a502)
      2010-04-14 19:42:15,201 DEBUG [org.jboss.test.cluster.rspfilter.TruthfulResponseFilter] (OOB-16,null) isAcceptable (true) from 10.16.93.34:55200
      2010-04-14 19:42:15,202 DEBUG [org.jboss.test.cluster.rspfilter.TruthfulResponseFilter] (OOB-15,null) isAcceptable (false) from 10.16.93.33:55200
      2010-04-14 19:42:15,202 DEBUG [org.jboss.test.cluster.rspfilter.TruthfulResponseFilter] (OOB-16,null) Lookup succeded from 10.16.93.34:55200
      2010-04-14 19:42:15,202 DEBUG [org.jboss.test.cluster.rspfilter.TruthfulResponseFilter] (OOB-15,null) needMoreResponses? true
      2010-04-14 19:42:15,202 DEBUG [org.jboss.test.cluster.rspfilter.TruthfulResponseFilter] (OOB-16,null) needMoreResponses? true

      I'll also change LookupSucceededFilter.isAcceptable() to return false if the response is null, Exception or NoHandlerForRpc. HAPartition or HAJNDI.lookupRemotely() already ignore such values so there is no point accepting them.

      Attachments

        Issue Links

          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: