afedulov commented on code in PR #19228:
URL: https://github.com/apache/flink/pull/19228#discussion_r869243696


##########
flink-runtime/src/main/java/org/apache/flink/runtime/messages/ThreadInfoSample.java:
##########
@@ -67,11 +67,15 @@ public static Optional<ThreadInfoSample> from(@Nullable 
ThreadInfo threadInfo) {
      * @param threadInfos {@link ThreadInfo} array where the data will be 
copied from.
      * @return a Collection of the corresponding {@link ThreadInfoSample}s
      */
-    public static Collection<ThreadInfoSample> from(ThreadInfo[] threadInfos) {
+    public static Collection<ThreadInfoSample> from(
+            ThreadInfo[] threadInfos, long[] requestedThreadIds) {
         Collection<ThreadInfoSample> result = new ArrayList<>();
-        for (ThreadInfo threadInfo : threadInfos) {
+        for (int i = 0; i < threadInfos.length; i++) {
+            ThreadInfo threadInfo = threadInfos[i];
             if (threadInfo == null) {
-                LOG.warn("Missing thread info.");
+                LOG.warn(
+                        "FlameGraphs: thread {} is not alive or does not 
exist.",
+                        requestedThreadIds[i]);
             } else {

Review Comment:
   > I'd still prefer it on call site and have the invariant that all 
ThreadInfo is non-null. Arrays with nulls are a nightmare and I don't see that 
this is necessary here (it's not a concurrent section where nulls cannot be 
avoided sometimes).
   
   Moved to the call site.



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