Skip to content
Snippets Groups Projects
Commit abcfaa93 authored by felmer's avatar felmer
Browse files

SSDM-2520: Breaking the loop in...

SSDM-2520: Breaking the loop in DataSetStorageAlgorithmRunner.registerDataWithRecovery() if an InterruptedException occurs.

SVN: 34819
parent 51b90aff
No related branches found
No related tags found
No related merge requests found
......@@ -23,6 +23,8 @@ import java.util.List;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.apache.log4j.Logger;
import ch.systemsx.cisd.base.exceptions.CheckedExceptionTunnel;
import ch.systemsx.cisd.base.exceptions.InterruptedExceptionUnchecked;
import ch.systemsx.cisd.common.concurrent.ConcurrencyUtilities;
import ch.systemsx.cisd.common.logging.LogCategory;
import ch.systemsx.cisd.common.logging.LogFactory;
......@@ -628,8 +630,7 @@ public class DataSetStorageAlgorithmRunner<T extends DataSetInformation>
case IN_PROGRESS:
operationLog
.debug("The registration is in progress. Will wait until it's done.");
waitTheRetryPeriod();
interruptOrWaitTheRetryPeriod(problem);
break;
case NO_OPERATION:
......@@ -646,7 +647,7 @@ public class DataSetStorageAlgorithmRunner<T extends DataSetInformation>
+ " time. Will continue retrying after "
+ registrationRetryPauseInSec + " seconds");
}
waitTheRetryPeriod();
interruptOrWaitTheRetryPeriod(problem);
break;
case OPERATION_SUCCEEDED:
......@@ -660,6 +661,17 @@ public class DataSetStorageAlgorithmRunner<T extends DataSetInformation>
}
}
private void interruptOrWaitTheRetryPeriod(Throwable throwable)
{
Throwable rootCause = ExceptionUtils.getRootCause(throwable);
if (rootCause instanceof InterruptedException || rootCause instanceof InterruptedExceptionUnchecked)
{
throw CheckedExceptionTunnel.wrapIfNecessary(throwable);
}
waitTheRetryPeriod();
}
/**
* Checks if the operations have succeeded in AS. Never give up if can't connect.
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment