Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Commit

Permalink
Bug 1232847 - Increase timeout for repair operation
Browse files Browse the repository at this point in the history
Increase timeout for all long running storage node operations to 7 days.
  • Loading branch information
Libor Zoubek committed Sep 22, 2015
1 parent 1254b9f commit d9a7ed8
Showing 1 changed file with 6 additions and 9 deletions.
Expand Up @@ -15,7 +15,7 @@

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.joda.time.Hours;
import org.joda.time.Days;

import org.rhq.cassandra.schema.Table;
import org.rhq.core.domain.auth.Subject;
Expand Down Expand Up @@ -54,6 +54,7 @@ public class StorageNodeOperationsHandlerBean implements StorageNodeOperationsHa
private final static String RUN_REPAIR_PROPERTY = "runRepair";
private final static String UPDATE_SEEDS_LIST = "updateSeedsList";
private final static String SEEDS_LIST = "seedsList";
private static final int LONG_RUNNING_OPERATION_TIMEOUT = Days.SEVEN.toStandardSeconds().getSeconds();

@PersistenceContext(unitName = RHQConstants.PERSISTENCE_UNIT_NAME)
private EntityManager entityManager;
Expand Down Expand Up @@ -286,8 +287,7 @@ private void performAddNodeMaintenance(Subject subject, StorageNode storageNode,
params.put(new PropertySimple(UPDATE_SEEDS_LIST, Boolean.TRUE));
params.put(new PropertySimple("newNodeAddress", newNodeAddress));

scheduleOperation(subject, storageNode, params, "addNodeMaintenance", Hours.EIGHT.toStandardSeconds()
.getSeconds());
scheduleOperation(subject, storageNode, params, "addNodeMaintenance", LONG_RUNNING_OPERATION_TIMEOUT);
StorageClusterSettings settings = storageClusterSettingsManager.getClusterSettings(subject);
storageNodeManager.scheduleSnapshotManagementOperationsForStorageNode(subject, storageNode, settings);
}
Expand Down Expand Up @@ -325,8 +325,7 @@ private void performRemoveNodeMaintenance(Subject subject, StorageNode storageNo
params.put(new PropertySimple(UPDATE_SEEDS_LIST, true));
params.put(new PropertySimple("removedNodeAddress", removedNodeAddress));

scheduleOperation(subject, storageNode, params, "removeNodeMaintenance", Hours.EIGHT.toStandardSeconds()
.getSeconds());
scheduleOperation(subject, storageNode, params, "removeNodeMaintenance", LONG_RUNNING_OPERATION_TIMEOUT);
}

@Override
Expand Down Expand Up @@ -622,13 +621,11 @@ public void runRepair(Subject subject) {
}
StorageNode storageNode = storageNodeOperationsHandler.setMode(clusterNodes.get(0),
StorageNode.OperationMode.MAINTENANCE);
scheduleOperation(subject, storageNode, new Configuration(), "repair", Hours.SIX.toStandardSeconds()
.getSeconds());
scheduleOperation(subject, storageNode, new Configuration(), "repair", LONG_RUNNING_OPERATION_TIMEOUT);
}

private void runRepair(Subject subject, StorageNode storageNode) {
scheduleOperation(subject, storageNode, new Configuration(), "repair", Hours.SIX.toStandardSeconds()
.getSeconds());
scheduleOperation(subject, storageNode, new Configuration(), "repair", LONG_RUNNING_OPERATION_TIMEOUT);
}

@Override
Expand Down

0 comments on commit d9a7ed8

Please sign in to comment.