[ openjms-Bugs-1192265 ] Message lost in multi-processor environment

"SourceForge.net" <[email protected]> Mon, 10 Oct 2005 07:15:06 -0700
Newsgroups gmane.comp.java.openjms.devel
Message-ID <[email protected]>
Bugs item #1192265, was opened at 2005-04-29 18:22
Message generated for change (Comment added) made by tanderson
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=474136&aid=1192265&group_id=54559

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: server
Group: v0.7.6.1
>Status: Closed
>Resolution: Fixed
Priority: 7
Submitted By: shyan (shyan)
Assigned to: Tim Anderson (tanderson)
>Summary: Message lost in multi-processor environment

Initial Comment:
I found message lost sometime in multi-processor 
envirement.
I test and simulate this situation and get the following 
result.

Sometime messages get the same sequenceNumber.

so message handle have same sequenceNumber in
PMDVector and persistent storage(DB).
When cunsumer receive message,the message handle 
removed from  PMDVector.

Because MessageHandleComparator only compare 
three attributes
(priority,acceptedtime,sequencedNumber) ,so if the 
three attributes equal,the handle is equal.

Two elements(or more) is removed from PMDVector.

So some messages lost,but thoses message still exists 
in database.

You can send two messages to server,and shutdown 
server.
Then modify two record's acceptedtime and 
sequenceedNumber to same value.
Start server and receive all message,you can only get 
one message,and the lost message is still exist in db.

I have a solution to fix this problem.
Add messageid conditition  in 
MessageHandleComparator.compare method to avoid 
compare confuse,because messageid is always unique.

The attache file is my patch.

----------------------------------------------------------------------

>Comment By: Tim Anderson (tanderson)
Date: 2005-10-11 00:15

Message:
Logged In: YES 
user_id=557161

Fixed in CVS. Fix will be available in 0.7.7-alpha-2

----------------------------------------------------------------------

Comment By: Tim Anderson (tanderson)
Date: 2005-10-11 00:07

Message:
Logged In: YES 
user_id=557161

Good catch, but a better solution is to synchronize the sequence 
no. generation in MessageMgr.java. Two messages should never 
be assigned identical sequence numbers.

Also note that the object database is no longer supported in 0.7.7

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=474136&aid=1192265&group_id=54559


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl