Skip to content

Commit 21afc78

Browse files
committed
Reduce log level for pipeline failure (#54097)
Today we log `failed to execute pipeline for a bulk request` at `ERROR` level if an attempt to run an ingest pipeline fails. A failure here is commonly due to an `EsRejectedExecutionException`. We also feed such failures back to the client and record the rejection in the threadpool statistics. In line with #51459 there is no need to log failures within actions so noisily and with such urgency. It is better to leave it up to the client to react accordingly. Typically an `EsRejectedExecutionException` should result in the client backing off and retrying, so a failure here is not normally fatal enough to justify an `ERROR` log at all. This commit reduces the log level for this message to `DEBUG`.
1 parent 6a60f85 commit 21afc78

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

server/src/main/java/org/elasticsearch/action/bulk/TransportBulkAction.java

+6-4
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@
9696
*/
9797
public class TransportBulkAction extends HandledTransportAction<BulkRequest, BulkResponse> {
9898

99+
private static final Logger logger = LogManager.getLogger(TransportBulkAction.class);
100+
99101
private final ThreadPool threadPool;
100102
private final AutoCreateIndex autoCreateIndex;
101103
private final ClusterService clusterService;
@@ -638,7 +640,7 @@ private long relativeTime() {
638640
return relativeTimeProvider.getAsLong();
639641
}
640642

641-
void processBulkIndexIngestRequest(Task task, BulkRequest original, ActionListener<BulkResponse> listener) {
643+
private void processBulkIndexIngestRequest(Task task, BulkRequest original, ActionListener<BulkResponse> listener) {
642644
final long ingestStartTimeInNanos = System.nanoTime();
643645
final BulkRequestModifier bulkRequestModifier = new BulkRequestModifier(original);
644646
ingestService.executeBulkRequest(
@@ -647,7 +649,7 @@ void processBulkIndexIngestRequest(Task task, BulkRequest original, ActionListen
647649
bulkRequestModifier::markItemAsFailed,
648650
(originalThread, exception) -> {
649651
if (exception != null) {
650-
logger.error("failed to execute pipeline for a bulk request", exception);
652+
logger.debug("failed to execute pipeline for a bulk request", exception);
651653
listener.onFailure(exception);
652654
} else {
653655
long ingestTookInMillis = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - ingestStartTimeInNanos);
@@ -696,7 +698,7 @@ public boolean isForceExecution() {
696698

697699
static final class BulkRequestModifier implements Iterator<DocWriteRequest<?>> {
698700

699-
private static final Logger LOGGER = LogManager.getLogger(BulkRequestModifier.class);
701+
private static final Logger logger = LogManager.getLogger(BulkRequestModifier.class);
700702

701703
final BulkRequest bulkRequest;
702704
final SparseFixedBitSet failedSlots;
@@ -778,7 +780,7 @@ synchronized void markItemAsDropped(int slot) {
778780

779781
synchronized void markItemAsFailed(int slot, Exception e) {
780782
IndexRequest indexRequest = getIndexWriteRequest(bulkRequest.requests().get(slot));
781-
LOGGER.debug(() -> new ParameterizedMessage("failed to execute pipeline [{}] for document [{}/{}/{}]",
783+
logger.debug(() -> new ParameterizedMessage("failed to execute pipeline [{}] for document [{}/{}/{}]",
782784
indexRequest.getPipeline(), indexRequest.index(), indexRequest.type(), indexRequest.id()), e);
783785

784786
// We hit a error during preprocessing a request, so we:

0 commit comments

Comments
 (0)