wu-sheng commented on a change in pull request #4220: sniffer processing profile task and report status and snapshot URL: https://github.com/apache/skywalking/pull/4220#discussion_r367265071
########## File path: apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/TracingContext.java ########## @@ -462,16 +485,34 @@ public boolean stopSpan(AbstractSpan span) { finish(); } + @Override + public void profilingRecheck(AbstractSpan span, String operationName) { + // only recheck first span + if (span.getSpanId() != 0) { + return; + } + + profiling = PROFILE_TASK_EXECUTION_SERVICE.profilingRecheck(this, segment.getTraceSegmentId(), operationName); + } + /** * Finish this context, and notify all {@link TracingContextListener}s, managed by {@link - * TracingContext.ListenerManager} + * TracingContext.ListenerManager} and {@link TracingContext.TracingThreadListenerManager} */ private void finish() { if (isRunningInAsyncMode) { asyncFinishLock.lock(); } try { - if (activeSpanStack.isEmpty() && running && (!isRunningInAsyncMode || asyncSpanCounter.get() == 0)) { + boolean tracingFinishInMainThread = activeSpanStack.isEmpty() && running; Review comment: `tracingFinishInMainThread` -> `isFinishedInMainThread` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services