-
1. Re: JMSBridgeReconnectTest.testStopBridgeWithFailureWhenStarted fails
timfox Apr 14, 2010 6:12 PM (in response to timfox)Easy to reproduce:
public void test() throws Exception
{
for (int i = 0; i < 1000000; i++)
{
log.info("** ITER "+ i);
this.testStopBridgeWithFailureWhenStarted();
tearDown();
setUp();
}
} -
2. Re: JMSBridgeReconnectTest.testStopBridgeWithFailureWhenStarted fails
timfox Apr 14, 2010 6:16 PM (in response to timfox)There are a few issues with your fix for this JIRA:
1) The stopping flag is not volatile, so threads may cache stale values
2) The stop() method should only exit when the bridge is no longer doing anything. Right now the bridge continues processing after stop has executed.
-
3. Re: JMSBridgeReconnectTest.testStopBridgeWithFailureWhenStarted fails
jmesnil Apr 15, 2010 3:24 AM (in response to timfox)i'll fix it
-
4. Re: JMSBridgeReconnectTest.testStopBridgeWithFailureWhenStarted fails
timfox Apr 15, 2010 5:40 AM (in response to jmesnil)Your latest fix is ugly and prone to more race conditions.
Having separate threads for each handler is unnecessary.
Just have the bridge maintain a single thread executor and all the actions use that.
Then when you want to stop(), simply set the stopping flag, add a future to the executor and wait completion, no need for interrupts().
This is the clean way to do it.