Skip to content

Commit d15ded5

Browse files
committed
introduce a new exception for segment upload failures and handle interrupted latch.await
Signed-off-by: Varun Bansal <[email protected]>
1 parent 85416eb commit d15ded5

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

server/src/main/java/org/opensearch/index/shard/RemoteStoreRefreshListener.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ public void onFailure(Exception e) {
295295
remoteStoreSettings.getClusterRemoteSegmentTransferTimeout().millis(),
296296
TimeUnit.MILLISECONDS
297297
) == false) {
298-
throw new InterruptedException("Timeout while waiting for remote segment transfer to complete");
298+
throw new SegmentUploadFailedException("Timeout while waiting for remote segment transfer to complete");
299299
}
300300
} catch (EngineException e) {
301301
logger.warn("Exception while reading SegmentInfosSnapshot", e);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
9+
package org.opensearch.index.shard;
10+
11+
import java.io.IOException;
12+
13+
public class SegmentUploadFailedException extends IOException {
14+
15+
public SegmentUploadFailedException(String message) {
16+
super(message);
17+
}
18+
}

0 commit comments

Comments
 (0)