[
https://issues.apache.org/jira/browse/FLINK-30621?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17677324#comment-17677324
]
Matthias Pohl commented on FLINK-30621:
---------------------------------------
I looked into some other tests. For the [test-ci/core job of
20230116.1|https://dev.azure.com/apache-flink/apache-flink/_build/results?buildId=44863&view=logs&j=0da23115-68bb-5dcd-192c-bd4c8adebde1&t=24c3384f-1bcb-57b3-224f-51bf973bbee8&l=8140]
module, there are test cases that have this warning even though they are not
using the {{ComponentMainThreadExecutorServiceAdapter}}. It's odd, though, that
in the aforementioned build, we see the warning for a test like
{{BlobClientSslTest.testNonSSLConnection}} which doesn't use the main
thread-related components:
{code}
00:58:52,799 [ main] INFO
org.apache.flink.runtime.blob.BlobClientSslTest [] -
================================================================================
Test testNonSSLConnection(org.apache.flink.runtime.blob.BlobClientSslTest) is
running.
--------------------------------------------------------------------------------
00:58:55,198 [ pool-160-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-160-thread-1,5,main]>.
java.lang.Exception: Violation of main thread constraint detected: expected
<Thread[main,5,main]> but running in <Thread[pool-160-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/:?]
at
org.apache.flink.runtime.concurrent.ComponentMainThreadExecutorServiceAdapter.assertRunningInMainThread(ComponentMainThreadExecutorServiceAdapter.java:86)
~[test-classes/:?]
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]
00:58:55,205 [ pool-161-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-161-thread-1,5,main]>.
java.lang.Exception: Violation of main thread constraint detected: expected
<Thread[main,5,main]> but running in <Thread[pool-161-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/:?]
at
org.apache.flink.runtime.concurrent.ComponentMainThreadExecutorServiceAdapter.assertRunningInMainThread(ComponentMainThreadExecutorServiceAdapter.java:86)
~[test-classes/:?]
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}
> 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.16.0, 1.17.0, 1.15.3
> 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)