You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2019/08/01 15:18:03 UTC
[GitHub] [skywalking] wu-sheng commented on a change in pull request #3201:
improve AsyncSpan API: make #asyncFinish and #prepareForAsync can not
invoke more than once
wu-sheng commented on a change in pull request #3201: improve AsyncSpan API: make #asyncFinish and #prepareForAsync can not invoke more than once
URL: https://github.com/apache/skywalking/pull/3201#discussion_r309754421
##########
File path: apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/trace/AbstractTracingSpan.java
##########
@@ -322,18 +322,26 @@ public AbstractSpan start(long startTime) {
}
@Override public AbstractSpan prepareForAsync() {
+ if (inAsyncMode) {
+ throw new RuntimeException("Span is already in async mode, please do not call '#prepareForAsync' more than on the same span!");
+ }
context = ContextManager.awaitFinishAsync(this);
isInAsyncMode = true;
return this;
}
+ private volatile boolean asyncStop = false;
Review comment:
Also, why the field is put here randomly?
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services