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

Martijn Visser commented on FLINK-40446:
----------------------------------------

Two more release-1.20 occurrences since yesterday, both on 2026-09-15 and on 
both parameterisations:

    
https://dev.azure.com/apache-flink/apache-flink/_build/results?buildId=79075 
(four legs)
    https://github.com/apache/flink/actions/runs/34919682822

    {code}
    java.io.IOException: Failed to delete temp directory 
/tmp/junit6722539831362498314. The following paths could not be deleted (see 
suppressed exceptions for details): 
8d739f0d4447476cb43f190aeaec7262/taskowned/job_8d739f0d4447476cb43f190aeaec7262_tm_a76e9461-841f-40e2-8a64-11d29d4e5795/73876611-3917-43d6-94ba-9fe5c1d6d647
    {code}

> UnalignedCheckpointRescaleWithMixedExchangesITCase is unstable: @TempDir 
> cleanup races with post-cancel async checkpoint
> ------------------------------------------------------------------------------------------------------------------------
>
>                 Key: FLINK-40446
>                 URL: https://issues.apache.org/jira/browse/FLINK-40446
>             Project: Flink
>          Issue Type: Bug
>            Reporter: Rui Fan
>            Assignee: Rui Fan
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 2.4.0
>
>
> UnalignedCheckpointRescaleWithMixedExchangesITCase.testRescaleFromUnalignedCheckpoint
>  is occasionally unstable. The test body passes, but teardown fails:
> {code:java}
>   java.io.IOException: Failed to delete temp directory /tmp/junit-...
>     Suppressed: java.nio.file.DirectoryNotEmptyException: /tmp/junit-...{code}
> Root cause: the test ends each job with `jobClient.cancel().get()`. cancel() 
> is
> asynchronous, so .get() only means cancellation was acknowledged, not that 
> the job
> reached a terminal state. The test then returns and JUnit deletes the 
> @TempDir (which
> also serves as the checkpoint dir) while the source subtasks' async snapshot 
> of the
> just-completed checkpoint is still writing SourceReaderState into the 
> file-merging
> "taskowned" directory. The post-order delete walk then hits 
> DirectoryNotEmptyException.
> It only reproduces with file-merging enabled 
> (execution.checkpointing.file-merging.enabled
> = true), which is why it shows up on a fraction of runs.
> Fix: wait for the job to reach the CANCELED terminal state before proceeding, 
> instead of
> relying on cancel().get() alone. (CommonTestUtils.terminateJob now waits for 
> CANCELED,
> and the UC rescale ITCases go through it.)



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

Reply via email to