From c950e8eaff2b3fa064aea13cbbe3808d86988f78 Mon Sep 17 00:00:00 2001 From: Shreyansh Ray Date: Tue, 3 Oct 2023 22:31:45 +0530 Subject: [PATCH] Fix test failures due to Span not being properly closed Signed-off-by: Shreyansh Ray --- .../action/support/replication/TransportReplicationAction.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/src/main/java/org/opensearch/action/support/replication/TransportReplicationAction.java b/server/src/main/java/org/opensearch/action/support/replication/TransportReplicationAction.java index 68598cad802b3..6313e4094dee2 100644 --- a/server/src/main/java/org/opensearch/action/support/replication/TransportReplicationAction.java +++ b/server/src/main/java/org/opensearch/action/support/replication/TransportReplicationAction.java @@ -423,6 +423,7 @@ protected void handlePrimaryRequest(final ConcreteShardRequest request, new AsyncPrimaryAction(request, TraceableActionListener.create(listener, span, getTracer()), (ReplicationTask) task).run(); } catch (RuntimeException e) { listener.onFailure(e); + span.endSpan(); } } @@ -708,6 +709,7 @@ protected void handleReplicaRequest( .run(); } catch (RuntimeException e) { listener.onFailure(e); + span.endSpan(); } }