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

Martijn Visser commented on FLINK-39962:
----------------------------------------

Another occurrence, master push 2026-10-02 (JDK 17), with a different exception 
than the description:
https://github.com/apache/flink/actions/runs/36970477581/job/110725247888

{code}
[ERROR] 
org.apache.flink.runtime.jobmaster.slotpool.DeclarativeSlotPoolBridgeTest.testAcceptingOfferedSlotsWithoutResourceManagerConnected
 -- Time elapsed: 0.036 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.DefaultDeclarativeSlotPool.internalOfferSlots(DefaultDeclarativeSlotPool.java:283)
        at 
org.apache.flink.runtime.jobmaster.slotpool.DefaultDeclarativeSlotPool.offerSlots(DefaultDeclarativeSlotPool.java:241)
        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}

The test passed in the Azure core stage of the same commit. PR #28535 was 
closed without being merged.

> Runtime: 
> DeclarativeSlotPoolBridgeTest.testAcceptingOfferedSlotsWithoutResourceManagerConnected
>  flaky
> -----------------------------------------------------------------------------------------------------
>
>                 Key: FLINK-39962
>                 URL: https://issues.apache.org/jira/browse/FLINK-39962
>             Project: Flink
>          Issue Type: Bug
>          Components: Runtime / Coordination
>            Reporter: Purushottam Sinha
>            Priority: Minor
>              Labels: pull-request-available
>
> 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
(v8.20.10#820010)

Reply via email to