You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Roman Khachatryan (Jira)" <ji...@apache.org> on 2026/01/25 10:31:00 UTC

[jira] [Created] (FLINK-38970) AdaptiveBatchSchedulerTest is unstable

Roman Khachatryan created FLINK-38970:
-----------------------------------------

             Summary: AdaptiveBatchSchedulerTest is unstable
                 Key: FLINK-38970
                 URL: https://issues.apache.org/jira/browse/FLINK-38970
             Project: Flink
          Issue Type: Bug
          Components: Tests
    Affects Versions: 2.3.0
            Reporter: Roman Khachatryan


When running locally, testAdaptiveBatchScheduler fails 1270 out of 3000 runs with
{code:java}
org.opentest4j.AssertionFailedError: 
expected: 10
 but was: -1
Expected :10
Actual   :-1

	at org.apache.flink.runtime.scheduler.adaptivebatch.AdaptiveBatchSchedulerTest.testAdaptiveBatchScheduler(AdaptiveBatchSchedulerTest.java:144)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at java.base/java.util.concurrent.ForkJoinTask.doExec$$$capture(ForkJoinTask.java:387)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188)
 {code}
With logging enabled, I see that some operations are executed on the wrong thread:
{code:java}
7083 [pool-5116-thread-1] WARN  org.apache.flink.runtime.rpc.MainThreadValidatorUtil [] - Violation of main thread constraint detected: expected <Thread[#5153,ForkJoinPool-2558-worker-1,5,main]> but running in <Thread[#5154,pool-5116-thread-1,5,main]>.
java.lang.Exception: Violation of main thread constraint detected: expected <Thread[#5153,ForkJoinPool-2558-worker-1,5,main]> but running in <Thread[#5154,pool-5116-thread-1,5,main]>.
	at org.apache.flink.runtime.rpc.MainThreadValidatorUtil.isRunningInExpectedThread(MainThreadValidatorUtil.java:73) ~[classes/:?]
	at org.apache.flink.runtime.concurrent.ComponentMainThreadExecutorServiceAdapter$1.execute(ComponentMainThreadExecutorServiceAdapter.java:66) ~[test-classes/:?]
	at org.apache.flink.util.concurrent.ScheduledExecutorServiceAdapter.execute(ScheduledExecutorServiceAdapter.java:64) ~[classes/:?]
	at org.apache.flink.runtime.concurrent.ComponentMainThreadExecutorServiceAdapter.execute(ComponentMainThreadExecutorServiceAdapter.java:128) ~[test-classes/:?]
	at java.base/java.util.concurrent.CompletableFuture$UniCompletion.claim(CompletableFuture.java:572) ~[?:?]
	at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1147) ~[?:?]
	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510) ~[?:?]
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run$$$capture(CompletableFuture.java:1773) ~[?:?]
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java) ~[?:?]
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) ~[?:?]
	at java.base/java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:317) ~[?:?]
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java) ~[?:?]
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
	at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
{code}



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