Skip to content

Commit 4939763

Browse files
Fix BulkRejectionIT (#41446)
* Due to #40866 one of the two parallel bulk requests can randomly be rejected outright when the write queue is full already, we can catch this situation and ignore it since we can still have the rejection for the dynamic mapping udate for the other reuqest and it's somewhat rare to run into this anyway * Closes #41363
1 parent 02ef53c commit 4939763

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

server/src/test/java/org/elasticsearch/action/bulk/BulkRejectionIT.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import org.elasticsearch.action.index.IndexRequest;
2323
import org.elasticsearch.action.support.WriteRequest;
2424
import org.elasticsearch.common.settings.Settings;
25+
import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException;
2526
import org.elasticsearch.test.ESIntegTestCase;
2627

2728
import java.util.Collections;
@@ -49,7 +50,6 @@ protected int numberOfShards() {
4950
return 5;
5051
}
5152

52-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/41363")
5353
public void testBulkRejectionAfterDynamicMappingUpdate() throws Exception {
5454
final String index = "test";
5555
assertAcked(prepareCreate(index));
@@ -68,8 +68,12 @@ public void testBulkRejectionAfterDynamicMappingUpdate() throws Exception {
6868
}
6969
final ActionFuture<BulkResponse> bulkFuture1 = client().bulk(request1);
7070
final ActionFuture<BulkResponse> bulkFuture2 = client().bulk(request2);
71-
bulkFuture1.actionGet();
72-
bulkFuture2.actionGet();
71+
try {
72+
bulkFuture1.actionGet();
73+
bulkFuture2.actionGet();
74+
} catch (EsRejectedExecutionException e) {
75+
// ignored, one of the two bulk requests was rejected outright due to the write queue being full
76+
}
7377
internalCluster().assertSeqNos();
7478
}
7579
}

0 commit comments

Comments
 (0)