From f0f7bb36ca885079ffbca0a56b57f8a7c58869c7 Mon Sep 17 00:00:00 2001 From: Suraj Singh Date: Mon, 10 Jul 2023 13:53:58 -0700 Subject: [PATCH] Stop timer inside try to prevent double stop on timer Signed-off-by: Suraj Singh --- .../indices/replication/SegmentReplicationSourceHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/main/java/org/opensearch/indices/replication/SegmentReplicationSourceHandler.java b/server/src/main/java/org/opensearch/indices/replication/SegmentReplicationSourceHandler.java index c054c8aa677a9..110fe9aafbf5f 100644 --- a/server/src/main/java/org/opensearch/indices/replication/SegmentReplicationSourceHandler.java +++ b/server/src/main/java/org/opensearch/indices/replication/SegmentReplicationSourceHandler.java @@ -170,9 +170,9 @@ public synchronized void sendFiles(GetSegmentFilesRequest request, ActionListene try { shard.updateVisibleCheckpointForShard(allocationId, copyState.getCheckpoint()); future.onResponse(new GetSegmentFilesResponse(List.of(storeFileMetadata))); + timer.stop(); } finally { IOUtils.close(resources); - timer.stop(); logger.trace( "[replication id {}] Source node completed sending files to target node [{}], timing: {}", request.getReplicationId(),