wu-sheng commented on code in PR #9916:
URL: https://github.com/apache/skywalking/pull/9916#discussion_r1015411815


##########
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/TraceQueryService.java:
##########
@@ -244,4 +268,61 @@ private void findChildren(List<Span> spans, Span 
parentSpan, List<Span> children
             }
         });
     }
+
+    private void appendAttachedEventsToSpan(List<Span> spans, 
List<SpanAttachedEventRecord> events) throws InvalidProtocolBufferException {
+        if (CollectionUtils.isEmpty(events)) {
+            return;
+        }
+
+        for (SpanAttachedEventRecord record : events) {
+            if (!StringUtils.isNumeric(record.getTraceSpanId())) {
+                continue;
+            }
+
+            // find matches span
+            final int eventSpanId = Integer.parseInt(record.getTraceSpanId());

Review Comment:
   I think we should check SpanReferenceType first, then do casting. Otherwise, 
we may face NPE or cast error, if trace ID actually exists on both sides. Such 
as Lua agent uses UUID as well.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to