[
https://issues.apache.org/jira/browse/FLINK-39962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18149803#comment-18149803
]
Martijn Visser commented on FLINK-39962:
----------------------------------------
Another one on release-2.4, nightly 2026-11-19 (Java 11, core), with the same
IllegalStateException as my previous comment:
https://github.com/apache/flink/actions/runs/44441141067/job/135287681568
{code}
[ERROR]
org.apache.flink.runtime.jobmaster.slotpool.DeclarativeSlotPoolBridgeTest.testAcceptingOfferedSlotsWithoutResourceManagerConnected
-- Time elapsed: 0.028 s <<< ERROR!
java.lang.IllegalStateException: The number of matched slots is not equals to
the pendingRequests.
at
org.apache.flink.runtime.jobmaster.slotpool.DeclarativeSlotPoolBridge.newSlotsAvailableForDeferAllocation(DeclarativeSlotPoolBridge.java:307)
at
org.apache.flink.runtime.jobmaster.slotpool.DeclarativeSlotPoolBridge.newSlotsAreAvailable(DeclarativeSlotPoolBridge.java:260)
at
org.apache.flink.runtime.jobmaster.slotpool.DeclarativeSlotPoolBridge.offerSlots(DeclarativeSlotPoolBridge.java:214)
at
org.apache.flink.runtime.jobmaster.slotpool.DeclarativeSlotPoolBridgeTest.testAcceptingOfferedSlotsWithoutResourceManagerConnected(DeclarativeSlotPoolBridgeTest.java:244)
{code}
Before that it failed on master (nightly 2026-11-04) and release-2.3 (push
2026-11-11) with {{NullPointerException: Cannot fulfill a non existing pending
slot request}}:
https://github.com/apache/flink/actions/runs/41757887087/job/126342289649
https://github.com/apache/flink/actions/runs/42969797682/job/130358038894
c0ee48e916f, which runs this test on a single threaded main executor, went to
master on 2026-11-09 as a hotfix and master has not failed since. I think we
should backport it to release-2.4 and release-2.3.
> Runtime:
> DeclarativeSlotPoolBridgeTest.testAcceptingOfferedSlotsWithoutResourceManagerConnected
> flaky
> -----------------------------------------------------------------------------------------------------
>
> Key: FLINK-39962
> URL: https://issues.apache.org/jira/browse/FLINK-39962
> Project: Flink
> Issue Type: Bug
> Components: Runtime / Coordination
> Affects Versions: 2.3.1, 2.4.0
> Reporter: Purushottam Sinha
> Priority: Major
> Labels: pull-request-available, test-stability
>
> Problem
> The test fails intermittently in CI with NegativeArraySizeException: -1,
> failing the core test module. It is a test-only threading race, not a
> production defect.
> Evidence
> - Stack: NegativeArraySizeException in LinkedHashMap$LinkedValues.toArray
> via DeclarativeSlotPoolBridge.cancelPendingRequests
> (DeclarativeSlotPoolBridge.java:228-229, new
> ArrayList<>(pendingRequests.values())) ← onClose (:176).
> - The bridge uses forMainThread(); onStart schedules
> checkIdleSlotTimeout/checkBatchSlotTimeout on that thread, but the test
> drives requestNewAllocatedSlot/offerSlots/close() from the test thread. A
> scheduled task mutates pendingRequests while close() copies it.
> - Observed on master commit 6627acb. CI:
> https://github.com/apache/flink/actions/runs/27864565978/job/82466897527
> Proposed fix
> - Drive the test lifecycle through componentMainThreadExecutor, or use a
> ManuallyTriggeredScheduledExecutor so timeout tasks cannot fire concurrently
> with close().
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)