[
https://issues.apache.org/jira/browse/FLINK-30621?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17656651#comment-17656651
]
Matthias Pohl commented on FLINK-30621:
---------------------------------------
I'm wondering how this works at all in general, This warning is triggered in
{{MainThreadValidatorUtil.isRunningInExpectedThread}} which returns {{false}}.
But the calling method
[ComponentMainThreadExecutorServiceAdapter#mainThreadCheck|https://github.com/apache/flink/blob/be75c0d82613726a7f508824730bbf2c9f6e8625/flink-runtime/src/test/java/org/apache/flink/runtime/concurrent/ComponentMainThreadExecutorServiceAdapter.java#L56]
does an assert on the return value which should fail in general. Do we disable
JVM assertions in our CI pipeline? Our couldn't find any evidence for that in
the code.
> Violation of main thread constraint detected
> --------------------------------------------
>
> Key: FLINK-30621
> URL: https://issues.apache.org/jira/browse/FLINK-30621
> Project: Flink
> Issue Type: Bug
> Components: Runtime / Coordination
> Affects Versions: 1.17.0
> Reporter: Matthias Pohl
> Priority: Critical
> Attachments: FLINK-30621.20230101.1.tar.gz
>
>
> When looking into FLINK-30540, I noticed the following warning being logged
> not only in the context of {{DataSinkTaskTest}}:
> {code}
> 00:56:09,055 [ pool-263-thread-1] WARN
> org.apache.flink.runtime.rpc.MainThreadValidatorUtil [] - Violation
> of main thread constraint detected: expected <Thread[main,5,main]> but
> running in <Thread[pool-263-thread-1,5,main]>.
> java.lang.Exception: Violation of main thread constraint detected: expected
> <Thread[main,5,main]> but running in <Thread[pool-263-thread-1,5,main]>.
> at
> org.apache.flink.runtime.rpc.MainThreadValidatorUtil.isRunningInExpectedThread(MainThreadValidatorUtil.java:73)
> ~[flink-rpc-core-1.17-SNAPSHOT.jar:1.17-SNAPSHOT]
> at
> org.apache.flink.runtime.concurrent.ComponentMainThreadExecutorServiceAdapter.lambda$new$0(ComponentMainThreadExecutorServiceAdapter.java:56)
> ~[test-classes/:1.17-SNAPSHOT]
> at
> org.apache.flink.runtime.concurrent.ComponentMainThreadExecutorServiceAdapter.assertRunningInMainThread(ComponentMainThreadExecutorServiceAdapter.java:86)
> ~[test-classes/:1.17-SNAPSHOT]
> at
> org.apache.flink.runtime.jobmaster.slotpool.DeclarativeSlotPoolBridge.assertRunningInMainThread(DeclarativeSlotPoolBridge.java:446)
> ~[classes/:?]
> at
> org.apache.flink.runtime.jobmaster.slotpool.DeclarativeSlotPoolBridge.checkBatchSlotTimeout(DeclarativeSlotPoolBridge.java:464)
> ~[classes/:?]
> at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
> [?:1.8.0_292]
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> [?:1.8.0_292]
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
> [?:1.8.0_292]
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
> [?:1.8.0_292]
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> [?:1.8.0_292]
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> [?:1.8.0_292]
> at java.lang.Thread.run(Thread.java:748) [?:1.8.0_292]
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)