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 2020/03/08 08:38:00 UTC
[GitHub] [skywalking] huangyoje edited a comment on issue #4462: [Agent
Core] Support lazy ContextCarrier injection and lazy peer id setting
huangyoje edited a comment on issue #4462: [Agent Core] Support lazy ContextCarrier injection and lazy peer id setting
URL: https://github.com/apache/skywalking/pull/4462#issuecomment-596180101
I just tried with this PR, and in my scenario, I encountered a problem:
1. I created `ExitSpan` without valid op name and peer host
2. the op name and peer host will be set to `ExitSpan` later, but the ordering is uncertain
3. but when can I invoke the `ExitSpan.inject(ContextCarrier)`?
Does the below way is OK?
```java
ContextCarrier tryInject(ExitSpan exitSpan) {
if (isValid(exitSpan)) {
return null;
}
ContextCarrier carrier = new ContextCarrier();
exitSpan.inject(carrier);
return carrier;
}
boolean isValid(ExitSpan exitSpan) {
return exitSpan.getOperatioName() != null && exitSpan.getPeer() != null;
}
```
----------------------------------------------------------------
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