Skip to content
Snippets Groups Projects
Commit 7257fb67 authored by brinn's avatar brinn
Browse files

fix: ensure the thread of a maintenance task continues running when the...

fix: ensure the thread of a maintenance task continues running when the maintenance task throws an exception (e.g. because the application server is down)

SVN: 20403
parent a9e1aedb
No related branches found
No related tags found
No related merge requests found
......@@ -5,12 +5,19 @@ import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.locks.ReentrantLock;
import org.apache.log4j.Logger;
import ch.systemsx.cisd.base.exceptions.CheckedExceptionTunnel;
import ch.systemsx.cisd.common.exceptions.ConfigurationFailureException;
import ch.systemsx.cisd.common.logging.LogCategory;
import ch.systemsx.cisd.common.logging.LogFactory;
import ch.systemsx.cisd.common.utilities.ClassUtils;
public class MaintenancePlugin
{
private static final Logger operationLog = LogFactory.getLogger(LogCategory.OPERATION,
MaintenancePlugin.class);
private static ReentrantLock dataStoreLock = new ReentrantLock();
private final IMaintenanceTask task;
......@@ -68,6 +75,10 @@ public class MaintenancePlugin
try
{
task.execute();
} catch (Throwable th)
{
operationLog.error("Exception when running maintenance task '"
+ task.getClass().getCanonicalName() + "'.", th);
} finally
{
releaseLockIfNecessay();
......
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