[
https://issues.jboss.org/browse/JGRP-1371?page=com.atlassian.jira.plugin....
]
Vladimir Blagojevic commented on JGRP-1371:
-------------------------------------------
Just to make sure we are on the same page here is a suggested patch (reimplementation of
blockMessageDuringFlush):
private void blockMessageDuringFlush() {
boolean shouldSuspendByItself = false;
blockMutex.lock();
try {
while (isBlockingFlushDown) {
if (log.isDebugEnabled())
log.debug(localAddress + ": blocking for " + (timeout <=
0 ? "ever" : timeout + "ms"));
if(timeout <= 0) {
notBlockedDown.await();
}
else {
shouldSuspendByItself = !notBlockedDown.await(timeout,
TimeUnit.MILLISECONDS);
}
if (shouldSuspendByItself) {
isBlockingFlushDown = false;
log.warn(localAddress + ": unblocking after " + timeout +
"ms");
flush_promise.setResult(new FlushStartResult(Boolean.TRUE,null));
notBlockedDown.signalAll();
}
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
} finally {
blockMutex.unlock();
}
}
Unable to suspend self in FLUSH.blockMessageDuringFlush(); Eternal
timeouts not supported
-----------------------------------------------------------------------------------------
Key: JGRP-1371
URL:
https://issues.jboss.org/browse/JGRP-1371
Project: JGroups
Issue Type: Bug
Affects Versions: 2.12.1
Environment: All
Reporter: Nicolas Estrada
Assignee: Vladimir Blagojevic
Priority: Critical
Fix For: 2.12.2, 3.0
If a positive timeout is specified for the FLUSH protocol, if the specified waiting time
timeout elapses during the notBlockedDown.await(timeout) invocation, the
shouldSuspendByItself flag will be set but it will continue looping forever. The if clause
below should be moved into the while block.
If the timeout is 0L or negative, instead of waiting forever, it will instantaneously
return from the await(timeout) method, but seeing as it can never suspend itself as
mentioned earlier, it will loop forever until a STOP_FLUSH or ABORT_FLUSH event is
received.
Changing the method to await() for "eternal" timeouts may be dangerous however;
There must be a guarantee that the isBlockingFlushDown is toggled even if the FLUSH
coordinator fails.
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira