Discussion:
[openjms-developer] [ openjms-Bugs-875922 ] Time to wait for retrieving message is incorrect
SourceForge.net
2004-01-21 04:08:45 UTC
Permalink
Bugs item #875922, was opened at 2004-01-13 19:12
Message generated for change (Comment added) made by tanderson
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: Closed
Resolution: Fixed
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)".


----------------------------------------------------------------------
Comment By: Tim Anderson (tanderson)
Date: 2004-01-21 15:08

Message:
Logged In: YES
user_id=557161

Fixed in CVS. Fix will be available in the 0.7.6 final release.

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

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