Skip to content

Commit

Permalink
revert AbstractAsyncTask changes
Browse files Browse the repository at this point in the history
Signed-off-by: Shivansh Arora <[email protected]>
  • Loading branch information
shiv0408 committed Jun 5, 2024
1 parent f0f6188 commit afa9b5e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,15 @@ public void testRemoteCleanupDeleteStale() throws Exception {
manifestFiles >= RETAINED_MANIFESTS && manifestFiles < RETAINED_MANIFESTS + 2 * SKIP_CLEANUP_STATE_CHANGES
);
}, 500, TimeUnit.MILLISECONDS);

// disable the clean up to avoid race condition during shutdown
response = client().admin()
.cluster()
.prepareUpdateSettings()
.setPersistentSettings(Settings.builder().put(REMOTE_CLUSTER_STATE_CLEANUP_INTERVAL_SETTING.getKey(), "-1"))
.get();

assertTrue(response.isAcknowledged());
}

private void updateClusterStateNTimes(int n) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,23 +107,7 @@ public synchronized void rescheduleIfNecessary() {
if (logger.isTraceEnabled()) {
logger.trace("scheduling {} every {}", toString(), interval);
}
try {
cancellable = threadPool.schedule(this, interval, getThreadPool());
} catch (OpenSearchRejectedExecutionException e) {
if (e.isExecutorShutdown()) {
logger.debug(
new ParameterizedMessage(
"could not schedule execution of [{}] after [{}] on [{}] as executor is shut down",
this,
interval,
getThreadPool()
),
e
);
} else {
throw e;
}
}
cancellable = threadPool.schedule(this, interval, getThreadPool());
isScheduledOrRunning = true;
} else {
logger.trace("scheduled {} disabled", toString());
Expand Down

0 comments on commit afa9b5e

Please sign in to comment.