FIX: NPE when thrift field is nested (#6909)
* FIX: NPE when field is nested * ADD: change.md Co-authored-by: Yang Xin <yangxinbj@fenbi.com>
This commit is contained in:
parent
004eef65ec
commit
0036ea674f
|
|
@ -23,6 +23,7 @@ Release Notes.
|
|||
* Add an optional agent plugin to support mybatis.
|
||||
* Add `spring-cloud-gateway-3.x` optional plugin.
|
||||
* Add `okhttp-4.x` plugin.
|
||||
* Fix NPE when thrift field is nested in plugin `thrift`
|
||||
|
||||
#### OAP-Backend
|
||||
* BugFix: filter invalid Envoy access logs whose socket address is empty.
|
||||
|
|
|
|||
|
|
@ -85,25 +85,29 @@ public class ServerInProtocolWrapper extends AbstractProtocolWrapper {
|
|||
}
|
||||
return readFieldBegin();
|
||||
}
|
||||
if (field.type == TType.STOP) {
|
||||
Boolean haveCreatedSpan =
|
||||
(Boolean) ContextManager.getRuntimeContext().get(HAVE_CREATED_SPAN);
|
||||
if (haveCreatedSpan != null && !haveCreatedSpan) {
|
||||
try {
|
||||
AbstractSpan span = ContextManager.createEntrySpan(
|
||||
context.getOperatorName(), createContextCarrier(null));
|
||||
span.start(context.startTime);
|
||||
span.tag(TAG_ARGS, context.getArguments());
|
||||
span.setComponent(ComponentsDefine.THRIFT_SERVER);
|
||||
SpanLayer.asRPCFramework(span);
|
||||
} catch (Throwable throwable) {
|
||||
LOGGER.error("Failed to create EntrySpan.", throwable);
|
||||
} finally {
|
||||
context = null;
|
||||
}
|
||||
|
||||
return field;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readMessageEnd() throws TException {
|
||||
super.readMessageEnd();
|
||||
Boolean haveCreatedSpan =
|
||||
(Boolean) ContextManager.getRuntimeContext().get(HAVE_CREATED_SPAN);
|
||||
if (haveCreatedSpan != null && !haveCreatedSpan) {
|
||||
try {
|
||||
AbstractSpan span = ContextManager.createEntrySpan(
|
||||
context.getOperatorName(), createContextCarrier(null));
|
||||
span.start(context.startTime);
|
||||
span.tag(TAG_ARGS, context.getArguments());
|
||||
span.setComponent(ComponentsDefine.THRIFT_SERVER);
|
||||
SpanLayer.asRPCFramework(span);
|
||||
} catch (Throwable throwable) {
|
||||
LOGGER.error("Failed to create EntrySpan.", throwable);
|
||||
} finally {
|
||||
context = null;
|
||||
}
|
||||
}
|
||||
return field;
|
||||
}
|
||||
|
||||
private ContextCarrier createContextCarrier(Map<String, String> header) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue