[jboss-jira] [JBoss JIRA] Updated: (JGRP-1239) Spurious warning "unblocking after xxx ms" from FLUSH.blockMessageDuringFlush()
Bela Ban (JIRA)
jira-events at lists.jboss.org
Thu Sep 23 14:34:56 EDT 2010
[ https://jira.jboss.org/browse/JGRP-1239?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bela Ban updated JGRP-1239:
---------------------------
Assignee: Vladimir Blagojevic (was: Bela Ban)
Fix Version/s: 2.10.1
2.11
> Spurious warning "unblocking after xxx ms" from FLUSH.blockMessageDuringFlush()
> -------------------------------------------------------------------------------
>
> Key: JGRP-1239
> URL: https://jira.jboss.org/browse/JGRP-1239
> Project: JGroups
> Issue Type: Bug
> Affects Versions: 2.10
> Environment: All
> Reporter: Eric Sirianni
> Assignee: Vladimir Blagojevic
> Priority: Minor
> Fix For: 2.10.1, 2.11
>
>
> JavaDoc from java.util.concurrent.locks.Condition.await(...) indicates that FALSE is returned if a timeout occurred.
> {code}
> /**
> * ...
> * @return {@code false} if the waiting time detectably elapsed
> * before return from the method, else {@code true}
> */
> boolean await(long time, TimeUnit unit) throws InterruptedException;
> {code}
> However, the JGroups code below is acting as if TRUE is returned if a timeout occurred.
> {code}
> private void blockMessageDuringFlush() {
> boolean shouldSuspendByItself = false;
> blockMutex.lock();
> try {
> while (isBlockingFlushDown) {
> if (log.isDebugEnabled())
> log.debug(localAddress + ": blocking for " + (timeout <= 0 ? "ever" : timeout + "ms"));
> shouldSuspendByItself = notBlockedDown.await(timeout, TimeUnit.MILLISECONDS);
> }
> if (shouldSuspendByItself) {
> isBlockingFlushDown = false;
> log.warn(localAddress + ": unblocking after " + timeout + "ms");
> flush_promise.setResult(Boolean.TRUE);
> notBlockedDown.signalAll();
> }
> } catch (InterruptedException e) {
> Thread.currentThread().interrupt();
> } finally {
> blockMutex.unlock();
> }
> }
> {code}
> This causes spurious WARNING level messages to be logged by JGroups when in fact no timeout occurred.
> The fix is simple:
> {noformat}
> < shouldSuspendByItself = notBlockedDown.await(timeout, TimeUnit.MILLISECONDS);
> --
> > shouldSuspendByItself = !notBlockedDown.await(timeout, TimeUnit.MILLISECONDS);
> {noformat}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list