diff --git a/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/AsyncDisableTrace.java b/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/AsyncDisableTrace.java index 080a9b3fa80a..d7585bc6ba4b 100644 --- a/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/AsyncDisableTrace.java +++ b/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/AsyncDisableTrace.java @@ -43,6 +43,7 @@ public AsyncDisableTrace(LocalTraceRoot traceRoot, public void close() { if (asyncState.await()) { // flush. + super.flush(); if (isDebug) { logger.debug("Await trace={}, asyncState={}", this, this.asyncState); } diff --git a/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/DefaultTrace.java b/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/DefaultTrace.java index 053682361319..ef001958b75d 100644 --- a/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/DefaultTrace.java +++ b/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/DefaultTrace.java @@ -120,7 +120,9 @@ private SpanEvent traceBlockBegin0(final int stackId) { private void stackDump(String caused) { PinpointException exception = new PinpointException(caused); - logger.warn("[DefaultTrace] Corrupted call stack found TraceRoot:{}, CallStack:{}", getTraceRoot(), callStack, exception); + if (logger.isWarnEnabled()) { + logger.warn("[{}] Corrupted call stack found TraceRoot:{}, CallStack:{}", getClass().getSimpleName(), getTraceRoot(), callStack, exception); + } } @Override @@ -199,7 +201,7 @@ public void close() { } - void flush() { + protected void flush() { this.storage.flush(); this.closed = true; } diff --git a/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/DisableTrace.java b/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/DisableTrace.java index 6e7335c98aec..af9b625c4ade 100644 --- a/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/DisableTrace.java +++ b/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/DisableTrace.java @@ -153,6 +153,10 @@ public void close() { this.closeListener.close(purgeTime); } + protected void flush() { + this.closed = true; + } + private boolean getStatus() { return getShared().getErrorCode() == 0; } diff --git a/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/id/ListenableAsyncState.java b/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/id/ListenableAsyncState.java index 76b1e607c5a2..4aecf6d0ae80 100644 --- a/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/id/ListenableAsyncState.java +++ b/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/id/ListenableAsyncState.java @@ -114,11 +114,17 @@ private boolean await0() { @InterfaceAudience.LimitedPrivate("LocalTraceContext") public interface AsyncStateListener { - AsyncStateListener EMPTY = () -> { - }; + AsyncStateListener EMPTY = new DisableAsyncStateListener(); + void finish(); } + static class DisableAsyncStateListener implements AsyncStateListener { + @Override + public void finish() { + } + } + @Override public String toString() { return "ListenableAsyncState{" +