Skip to content

Commit ab2bd40

Browse files
authored
Improving logging to troubelshoot pipeline metrics problem (#91439) (#91627)
1 parent 30e51f1 commit ab2bd40

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

server/src/main/java/org/elasticsearch/ingest/CompoundProcessor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ void innerExecute(int currentProcessor, IngestDocument ingestDocument, final BiC
213213
try {
214214
finalProcessor.execute(ingestDocument, (result, e) -> {
215215
if (listenerHasBeenCalled.getAndSet(true)) {
216-
logger.warn("A listener was unexpectedly called more than once", new RuntimeException());
216+
logger.warn("A listener was unexpectedly called more than once", new RuntimeException(e));
217217
assert false : "A listener was unexpectedly called more than once";
218218
} else {
219219
long ingestTimeInNanos = relativeTimeProvider.getAsLong() - startTimeInNanos;
@@ -233,7 +233,7 @@ void innerExecute(int currentProcessor, IngestDocument ingestDocument, final BiC
233233
} catch (Exception e) {
234234
long ingestTimeInNanos = relativeTimeProvider.getAsLong() - startTimeInNanos;
235235
if (postIngestHasBeenCalled.get()) {
236-
logger.warn("Preventing postIngest from being called more than once", new RuntimeException());
236+
logger.warn("Preventing postIngest from being called more than once", e);
237237
assert false : "Attempt to call postIngest more than once";
238238
} else {
239239
finalMetric.postIngest(ingestTimeInNanos);

server/src/main/java/org/elasticsearch/ingest/ConditionalProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public void execute(IngestDocument ingestDocument, BiConsumer<IngestDocument, Ex
135135
metric.preIngest();
136136
processor.execute(ingestDocument, (result, e) -> {
137137
if (listenerHasBeenCalled.getAndSet(true)) {
138-
logger.warn("A listener was unexpectedly called more than once", new RuntimeException());
138+
logger.warn("A listener was unexpectedly called more than once", new RuntimeException(e));
139139
assert false : "A listener was unexpectedly called more than once";
140140
} else {
141141
long ingestTimeInNanos = relativeTimeProvider.getAsLong() - startTimeInNanos;

server/src/main/java/org/elasticsearch/ingest/IngestService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ private void innerExecute(
894894
final AtomicBoolean listenerHasBeenCalled = new AtomicBoolean(false);
895895
ingestDocument.executePipeline(pipeline, (result, e) -> {
896896
if (listenerHasBeenCalled.getAndSet(true)) {
897-
logger.warn("A listener was unexpectedly called more than once", new RuntimeException());
897+
logger.warn("A listener was unexpectedly called more than once", new RuntimeException(e));
898898
assert false : "A listener was unexpectedly called more than once";
899899
} else {
900900
long ingestTimeInNanos = System.nanoTime() - startTimeInNanos;

server/src/main/java/org/elasticsearch/ingest/Pipeline.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public void execute(IngestDocument ingestDocument, BiConsumer<IngestDocument, Ex
128128
metrics.preIngest();
129129
compoundProcessor.execute(ingestDocument, (result, e) -> {
130130
if (listenerHasBeenCalled.getAndSet(true)) {
131-
logger.warn("A listener was unexpectedly called more than once", new RuntimeException());
131+
logger.warn("A listener was unexpectedly called more than once", new RuntimeException(e));
132132
assert false : "A listener was unexpectedly called more than once";
133133
} else {
134134
long ingestTimeInNanos = relativeTimeProvider.getAsLong() - startTimeInNanos;

0 commit comments

Comments
 (0)