From b086a7e4c5c48309d02152f76127c2ba1f62673a Mon Sep 17 00:00:00 2001 From: sricharanvuppu Date: Wed, 28 Jun 2023 15:34:09 +0530 Subject: [PATCH] correcting OpenSearchRejectedExecutionException import Signed-off-by: sricharanvuppu --- .../opensearch/replication/task/shard/TranslogSequencer.kt | 7 ------- .../kotlin/org/opensearch/replication/util/Extensions.kt | 4 ++-- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/main/kotlin/org/opensearch/replication/task/shard/TranslogSequencer.kt b/src/main/kotlin/org/opensearch/replication/task/shard/TranslogSequencer.kt index b1bb4ae8..5036df59 100644 --- a/src/main/kotlin/org/opensearch/replication/task/shard/TranslogSequencer.kt +++ b/src/main/kotlin/org/opensearch/replication/task/shard/TranslogSequencer.kt @@ -126,13 +126,6 @@ class TranslogSequencer(scope: CoroutineScope, private val replicationMetadata: } finally { rateLimiter.release() } -<<<<<<< HEAD - - val tookInNanos = System.nanoTime() - relativeStartNanos - followerClusterStats.stats[followerShardId]!!.totalWriteTime.addAndGet(TimeUnit.NANOSECONDS.toMillis(tookInNanos)) - followerClusterStats.stats[followerShardId]!!.opsWritten.addAndGet(replayRequest.changes.size.toLong()) -======= ->>>>>>> 448e7a7 (Handling OpenSearchRejectExecuteException Exception (#1004)) } highWatermark = next.changes.lastOrNull()?.seqNo() ?: highWatermark } diff --git a/src/main/kotlin/org/opensearch/replication/util/Extensions.kt b/src/main/kotlin/org/opensearch/replication/util/Extensions.kt index 643cc010..27596d6c 100644 --- a/src/main/kotlin/org/opensearch/replication/util/Extensions.kt +++ b/src/main/kotlin/org/opensearch/replication/util/Extensions.kt @@ -125,13 +125,13 @@ suspend fun Client.suspendExecuteWith // This waits for the dependencies to load and retry. Helps during boot-up || e.status().status >= 500 || e.status() == RestStatus.TOO_MANY_REQUESTS)) { - retryException = e; + retryException = e } else { throw e } } catch (e: OpenSearchRejectedExecutionException) { if(index < numberOfRetries-2) { - retryException = e; + retryException = e } else { throw ReplicationException(e, RestStatus.TOO_MANY_REQUESTS)