Skip to content

Commit

Permalink
fix logging and stage clean in client-mode, fix un-install
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed Mar 22, 2018
1 parent a9d70e5 commit 6dc4022
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Expand Up @@ -36,11 +36,15 @@ protected Map<String, Long> getBiggestBatchIds(List<BatchId> batches) {

@Override
public long clean(long ttlInMs) {
if (!engine.getClusterService().lock(ClusterConstants.STAGE_MANAGEMENT)) {
log.debug("Could not get a lock to run stage management");
return 0;
try {
if (!engine.getClusterService().lock(ClusterConstants.STAGE_MANAGEMENT)) {
log.debug("Could not get a lock to run stage management");
return 0;
}
} catch (Exception e) {
// during setup or un-install, it's possible sym_lock table isn't available yet
}

try {
boolean purgeBasedOnTTL = engine.getParameterService().is(ParameterConstants.STREAM_TO_FILE_PURGE_ON_TTL_ENABLED, false);
if (purgeBasedOnTTL) {
Expand All @@ -51,7 +55,10 @@ public long clean(long ttlInMs) {
}
}
} finally {
engine.getClusterService().unlock(ClusterConstants.STAGE_MANAGEMENT);
try {
engine.getClusterService().unlock(ClusterConstants.STAGE_MANAGEMENT);
} catch (Exception e) {
}
}
}

Expand Down
Expand Up @@ -23,7 +23,6 @@
import java.util.Date;
import java.util.List;

import org.apache.commons.lang.time.DateUtils;
import org.apache.log4j.PatternLayout;
import org.jumpmind.symmetric.AbstractSymmetricEngine;
import org.jumpmind.symmetric.ISymmetricEngine;
Expand Down

0 comments on commit 6dc4022

Please sign in to comment.