Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,9 @@ private boolean incrementIndexingPressure(IndexRequestWithIndexingPressure index
addInferenceResponseFailure(
itemIndex,
new InferenceException(
"Insufficient memory available to update source on document [" + indexRequest.getIndexRequest().id() + "]",
"Unable to insert inference results into document ["
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ Do we want to also mention update source here, or is it fine unifying the error msg?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, I think it's fine that we have a unified error message. The fact that this error is thrown prior to us actually updating source is an implementation detail we don't want to leak.

+ indexRequest.getIndexRequest().id()
+ "] due to memory pressure. Please retry the bulk request with fewer documents or smaller document sizes.",
e
)
);
Expand Down Expand Up @@ -749,7 +751,9 @@ private void applyInferenceResponses(BulkItemRequest item, FieldInferenceRespons
item.abort(
item.index(),
new InferenceException(
"Insufficient memory available to insert inference results into document [" + indexRequest.id() + "]",
"Unable to insert inference results into document ["
+ indexRequest.id()
+ "] due to memory pressure. Please retry the bulk request with fewer documents or smaller document sizes.",
e
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,10 @@ public void testIndexingPressureTripsOnInferenceRequestGeneration() throws Excep
BulkItemResponse.Failure doc1Failure = doc1Response.getFailure();
assertThat(
doc1Failure.getCause().getMessage(),
containsString("Insufficient memory available to update source on document [doc_1]")
containsString(
"Unable to insert inference results into document [doc_1]"
+ " due to memory pressure. Please retry the bulk request with fewer documents or smaller document sizes."
)
);
assertThat(doc1Failure.getCause().getCause(), instanceOf(EsRejectedExecutionException.class));
assertThat(doc1Failure.getStatus(), is(RestStatus.TOO_MANY_REQUESTS));
Expand Down Expand Up @@ -791,7 +794,8 @@ public void testIndexingPressureTripsOnInferenceResponseHandling() throws Except
BulkItemResponse.Failure doc1Failure = doc1Response.getFailure();
assertThat(
doc1Failure.getCause().getMessage(),
containsString("Insufficient memory available to insert inference results into document [doc_1]")
containsString("Unable to insert inference results into document [doc_1]"
+ " due to memory pressure. Please retry the bulk request with fewer documents or smaller document sizes.")
);
assertThat(doc1Failure.getCause().getCause(), instanceOf(EsRejectedExecutionException.class));
assertThat(doc1Failure.getStatus(), is(RestStatus.TOO_MANY_REQUESTS));
Expand Down Expand Up @@ -902,7 +906,8 @@ public void testIndexingPressurePartialFailure() throws Exception {
BulkItemResponse.Failure doc2Failure = doc2Response.getFailure();
assertThat(
doc2Failure.getCause().getMessage(),
containsString("Insufficient memory available to insert inference results into document [doc_2]")
containsString("Unable to insert inference results into document [doc_2]"
+ " due to memory pressure. Please retry the bulk request with fewer documents or smaller document sizes.")
);
assertThat(doc2Failure.getCause().getCause(), instanceOf(EsRejectedExecutionException.class));
assertThat(doc2Failure.getStatus(), is(RestStatus.TOO_MANY_REQUESTS));
Expand Down