[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [xmlblaster] volatile message problem



On Wed, Oct 30, 2002 at 08:50:26AM +0100, Marcel Ruff wrote:
> David Kerry wrote:
> 
> >Ok folks, another volatile message bug...
<snip>
> >
> Hi David,
> 
> it is good to have such a volatile tester!
> I'm busy the next days but this needs to be resolved a.s.a.p.
> 
> thanks for reporting
> 
> Marcel

This particular bug has been a bit of a critical issue for us,
so I delved into the code and have come up with a solution
for it.  Please find attached a patch that corrects this bug.

This bug fix does not resolve the other problems we're seeing
with volatile messages still, however (see Russell Chan's most
recent post for details).

-- 
David Kerry

Index: src/java/org/xmlBlaster/engine/RequestBroker.java
===================================================================
RCS file: /opt/cvsroot/xmlBlaster/src/java/org/xmlBlaster/engine/RequestBroker.java,v
retrieving revision 1.177
diff -c -r1.177 RequestBroker.java
*** src/java/org/xmlBlaster/engine/RequestBroker.java	2002/10/25 08:30:33	1.177
--- src/java/org/xmlBlaster/engine/RequestBroker.java	2002/10/31 05:32:40
***************
*** 1214,1227 ****
--- 1214,1235 ----
                 }
              }
  
+             // Increment counter so MsgQueue doesn't purge our message while we're still
+             // pushing it out to all the subscribers.
+             msgUnitHandler.getMessageUnitWrapper().addEnqueueCounter(1);
+ 
              //----- 2. now we can send updates to all interested clients:
              if (log.TRACE) log.trace(ME, "Message " + xmlKey.getKeyOid() + " handled, now we can send updates to all interested clients.");
+ 
              if (contentChanged || publishQos.forceUpdate()) // if the content changed of the publisher forces updates ...
                 msgUnitHandler.invokeCallback(sessionInfo, Constants.STATE_OK);
  
              //----- 3. check all known query subscriptions if the new message fits as well
              // TODO: Only check if it is a new message (XmlKey is immutable)
              checkExistingSubscriptions(sessionInfo, xmlKey, msgUnitHandler, publishQos);
+ 
+             // Unlock the counter now that we're done publishing
+             msgUnitHandler.getMessageUnitWrapper().addEnqueueCounter(-1);
  
              // First all callback calls must be successful - the CbWorker checks it as well
              if (msgUnitHandler.isPublishedWithData() &&