[ 
http://jira.jboss.com/jira/browse/JBAS-1481?page=comments#action_12315483 ]
     
Bela Ban commented on JBAS-1481:
--------------------------------

Here's the class that notifies listeners of view changes (in HAPartitionImpl):

 private class AsynchViewChangeHandler implements Runnable
   {
      public void run()
      {
         log.debug("Begin AsynchViewChangeHandler");
         while( true )
         {
            try
            {
               ViewChangeEvent event = (ViewChangeEvent) 
asynchViewChanges.take();
               notifyListeners(asynchListeners, event.viewId, event.allMembers,
                  event.deadMembers, event.newMembers, event.originatingGroups);
            }
            catch(InterruptedException e)
            {
               log.debug("AsynchViewChangeHandler interrupted", e);
               break;
            }
         }
         log.debug("End AsynchViewChangeHandler");
      }
   }


If that thread is interrupted, it won't notify listeners of view changes ! 

We start it in startPartition(), so 2 problems:
#1: the thread might get interrupted when it is *not* running yet (or anymore). 
Next time it runs, the interrupt flag is still set, therefore it will terminate 
!
#2: on redeploy, we get 2 threads !

> HAPartitionImpl.viewAccepted()
> ------------------------------
>
>          Key: JBAS-1481
>          URL: http://jira.jboss.com/jira/browse/JBAS-1481
>      Project: JBoss Application Server
>         Type: Bug
>   Components: Clustering
>     Reporter: Bela Ban

>
>
> Here's the end of the method:
> // Put the view change to the asynch queue
> this.asynchViewChanges.put(event); // #1
> // Broadcast the new view to the synchronous view change listeners
> this.notifyListeners(listeners, event.viewId, event.allMembers, // #2
>    event.deadMembers, event.newMembers, event.originatingGroups);
> #1 puts the view change on a queue, where another thread picks it up and 
> invokes notifyListeners()
> #2 does exactly the same, but *blocking* (not on a separate thread)
> We should remove #2 ? It is duplicate, dangerous code 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.jboss.com/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-Development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to