[Pogamut-list] Bug in UCCWrapper
nvh
pogamut-forum at artemis.ms.mff.cuni.cz
Wed Jan 28 15:40:43 CET 2009
Bug in UCCWrapper
Author: nvh
Currently I'm using UCCWrapper to start the server for my experiments, and I found a bug in the shutdown method of the wrapper. At the bottom of the file UCCWrapper.java the following code can be found:
^ // hook that will release all UCC instances when the program finishes
Runtime.getRuntime().addShutdownHook(new Thread("UCC wrapper finalizer") {
public void run() {
synchronized (poolRetrievalLock) {
while (!uccPool.isEmpty()) {
uccPool.iterator().next().close();
}
while (!uccUnreleased.isEmpty()) {
uccUnreleased.iterator().next().close();
}
}
}
});
^
The last while loop is an infinite one, because the close method only removes the wrappers from uccPool and not from the uccUnreleased. The line should be replaced with
^
uccUnreleased.iterator().next().release();
^
that way, the will not get stuck in an infinite loop of trying to close the UCCWrappers from uccUnreleased.
More information about the Pogamut-list
mailing list