Skip to content

Commit

Permalink
Improving logging to troubelshoot pipeline metrics problem (#91439) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
masseyke committed Nov 16, 2022
1 parent 30e51f1 commit ab2bd40
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ void innerExecute(int currentProcessor, IngestDocument ingestDocument, final BiC
try {
finalProcessor.execute(ingestDocument, (result, e) -> {
if (listenerHasBeenCalled.getAndSet(true)) {
logger.warn("A listener was unexpectedly called more than once", new RuntimeException());
logger.warn("A listener was unexpectedly called more than once", new RuntimeException(e));
assert false : "A listener was unexpectedly called more than once";
} else {
long ingestTimeInNanos = relativeTimeProvider.getAsLong() - startTimeInNanos;
Expand All @@ -233,7 +233,7 @@ void innerExecute(int currentProcessor, IngestDocument ingestDocument, final BiC
} catch (Exception e) {
long ingestTimeInNanos = relativeTimeProvider.getAsLong() - startTimeInNanos;
if (postIngestHasBeenCalled.get()) {
logger.warn("Preventing postIngest from being called more than once", new RuntimeException());
logger.warn("Preventing postIngest from being called more than once", e);
assert false : "Attempt to call postIngest more than once";
} else {
finalMetric.postIngest(ingestTimeInNanos);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public void execute(IngestDocument ingestDocument, BiConsumer<IngestDocument, Ex
metric.preIngest();
processor.execute(ingestDocument, (result, e) -> {
if (listenerHasBeenCalled.getAndSet(true)) {
logger.warn("A listener was unexpectedly called more than once", new RuntimeException());
logger.warn("A listener was unexpectedly called more than once", new RuntimeException(e));
assert false : "A listener was unexpectedly called more than once";
} else {
long ingestTimeInNanos = relativeTimeProvider.getAsLong() - startTimeInNanos;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ private void innerExecute(
final AtomicBoolean listenerHasBeenCalled = new AtomicBoolean(false);
ingestDocument.executePipeline(pipeline, (result, e) -> {
if (listenerHasBeenCalled.getAndSet(true)) {
logger.warn("A listener was unexpectedly called more than once", new RuntimeException());
logger.warn("A listener was unexpectedly called more than once", new RuntimeException(e));
assert false : "A listener was unexpectedly called more than once";
} else {
long ingestTimeInNanos = System.nanoTime() - startTimeInNanos;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public void execute(IngestDocument ingestDocument, BiConsumer<IngestDocument, Ex
metrics.preIngest();
compoundProcessor.execute(ingestDocument, (result, e) -> {
if (listenerHasBeenCalled.getAndSet(true)) {
logger.warn("A listener was unexpectedly called more than once", new RuntimeException());
logger.warn("A listener was unexpectedly called more than once", new RuntimeException(e));
assert false : "A listener was unexpectedly called more than once";
} else {
long ingestTimeInNanos = relativeTimeProvider.getAsLong() - startTimeInNanos;
Expand Down

0 comments on commit ab2bd40

Please sign in to comment.