Author: borges
Date: 2012-01-04 09:58:55 -0500 (Wed, 04 Jan 2012)
New Revision: 11963
Modified:
trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/SimpleWaitIOCallback.java
Log:
HORNETQ-820 Try to fix hang on SimpleWaitIOCallback assuming it is a lost wake-up
Modified:
trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/SimpleWaitIOCallback.java
===================================================================
---
trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/SimpleWaitIOCallback.java 2012-01-04
14:23:01 UTC (rev 11962)
+++
trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/SimpleWaitIOCallback.java 2012-01-04
14:58:55 UTC (rev 11963)
@@ -35,7 +35,8 @@
private volatile String errorMessage;
private volatile int errorCode = 0;
-
+
+ @Override
public String toString()
{
return "simpleWaitIOCallback";
@@ -60,7 +61,11 @@
@Override
public void waitCompletion() throws Exception
{
- latch.await();
+ while (true)
+ {
+ if (latch.await(2, TimeUnit.SECONDS))
+ break;
+ }
if (errorMessage != null)
{