You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Zhu Zhu (Jira)" <ji...@apache.org> on 2022/10/17 03:13:00 UTC

[jira] [Comment Edited] (FLINK-29629) FlameGraph is empty for Legacy Source Threads

    [ https://issues.apache.org/jira/browse/FLINK-29629?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17618392#comment-17618392 ] 

Zhu Zhu edited comment on FLINK-29629 at 10/17/22 3:12 AM:
-----------------------------------------------------------

Thanks for reporting this! [~pvary] I agree it is not ideal but I think it is not a bug. We know there are some tasks that can spawn other threads to do critical things(e.g. some sources and sinks) and they can encounter the same issue.
One solution might be to allow users to specify any thread (co-located with the given subtask) to create a flame graph. But I think we first need an end-to-end design for it.
What do you think?


was (Author: zhuzh):
Thanks for reporting this! I agree it is not ideal but I think it is not a bug. We know there are some tasks that can spawn other threads to do critical things(e.g. some sources and sinks) and they can encounter the same issue.
One solution might be to allow users to specify any thread (co-located with the given subtask) to create a flame graph. But I think we first need an end-to-end design for it.
What do you think?

> FlameGraph is empty for Legacy Source Threads
> ---------------------------------------------
>
>                 Key: FLINK-29629
>                 URL: https://issues.apache.org/jira/browse/FLINK-29629
>             Project: Flink
>          Issue Type: Bug
>          Components: Runtime / Web Frontend
>            Reporter: Peter Vary
>            Priority: Major
>
> Thread dump gets the stack trace for the {{Custom Source}} thread, but this thread is always in {{TIMED_WAITING}}:
> {code}
> "Source: Custom Source -> A random source (1/2)#0" ...
>    java.lang.Thread.State: TIMED_WAITING (parking)
> 	at jdk.internal.misc.Unsafe.park(java.base@11.0.16/Native Method)
> 	- parking to wait for  <0x00000000ea775750> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
> 	at java.util.concurrent.locks.LockSupport.parkNanos()
> 	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await()
> 	at org.apache.flink.streaming.runtime.tasks.mailbox.TaskMailboxImpl.take()
> 	at org.apache.flink.streaming.runtime.tasks.mailbox.MailboxProcessor.processMailsWhenDefaultActionUnavailable(MailboxProcessor.java:335)
> 	at org.apache.flink.streaming.runtime.tasks.mailbox.MailboxProcessor.processMail(MailboxProcessor.java:324)
> 	at org.apache.flink.streaming.runtime.tasks.mailbox.MailboxProcessor.runMailboxLoop(MailboxProcessor.java:201)
> [..]
> {code}
> The actual code is run in the {{Legacy Source Thread}}:
> {code}
> "Legacy Source Thread - Source: Custom Source -> A random source (1/2)#0" ...
>    java.lang.Thread.State: RUNNABLE
> {code}
> This causes the WebUI FlameGraph to be empty of any useful data.
> This is an example code to reproduce:
> {code}
> DataStream<RowData> inputStream = env.addSource(new RandomRecordSource(recordSize));
> inputStream = inputStream.map(new CounterMapper());
> FlinkSink.forRowData(inputStream).tableLoader(loader).append();
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)