From 1dd8bd385fd61fbb269e2eca17bca431189060bf Mon Sep 17 00:00:00 2001 From: kkondaka <41027584+kkondaka@users.noreply.github.com> Date: Mon, 26 Jun 2023 09:48:31 -0700 Subject: [PATCH] Fix DLQ writer writing empty list (#2931) Signed-off-by: Krishna Kondaka Co-authored-by: Krishna Kondaka --- .../plugins/sink/opensearch/BulkRetryStrategy.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/data-prepper-plugins/opensearch/src/main/java/org/opensearch/dataprepper/plugins/sink/opensearch/BulkRetryStrategy.java b/data-prepper-plugins/opensearch/src/main/java/org/opensearch/dataprepper/plugins/sink/opensearch/BulkRetryStrategy.java index fd639ab03b..b075fe7730 100644 --- a/data-prepper-plugins/opensearch/src/main/java/org/opensearch/dataprepper/plugins/sink/opensearch/BulkRetryStrategy.java +++ b/data-prepper-plugins/opensearch/src/main/java/org/opensearch/dataprepper/plugins/sink/opensearch/BulkRetryStrategy.java @@ -258,6 +258,10 @@ private void handleFailures(final AccumulatingBulkRequest bulkRequestForRetry = createBulkRequestForRetry(request, response); + if (bulkRequestForRetry.getOperationsCount() == 0) { + return null; + } + final BulkResponse bulkResponse; try { bulkResponse = requestFunction.apply(bulkRequestForRetry);