[ openjms-Bugs-875922 ] Time to wait for retrieving message is incorrect

"SourceForge.net" <[email protected]>
Newsgroups gmane.comp.java.openjms.devel
Message-ID <[email protected]>
Bugs item #875922, was opened at 2004-01-13 08:12
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=474136&aid=875922&group_id=54559

Category: message engine
Group: v0.7.6-rc3
Status: Open
Resolution: None
Priority: 5
Submitted By: Bo Min Jiang (bmjiang)
Assigned to: Jim Alateras (jalateras)
Summary: Time to wait for retrieving message is incorrect

Initial Comment:
I have an application that sends several messages at a 
time to a queue in OpenJMS. Occasionally, I will get a 
timeout error, even though I've specified the time to 
wait to be as much as 20 minutes.

Taking a look at the source for class JMSSession, it 
seems that there may be a bug in the algorithm used to 
determine how long to block for when waiting for a 
message. In the method retrieveMessage, the following 
code block appears:

// wait for a specific period of time
_receiveLock.wait(wait);
long current = System.currentTimeMillis();
if (current >= end) {
breakOnNextRead = true;
} else {
// update the time to wait. If the value
// is zero then break on the next read
wait -= (end - current);
if (wait == 0) {
breakOnNextRead = true;
}
}

When the receive lock is interrupted and the specified 
total time to wait hasn't passed yet, I think the 
remaining time to wait should be updated to the 
value "end - current", not "wait - (end - current)".


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

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


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.