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

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

[~fanrui] The fix for this is on master as 9c1015353f8 since 2026-08-20, but 
the ticket is still open with no fixVersion, and it was not backported. 
release-1.20 hits the same race in UnalignedCheckpointRescaleSameUpstreamITCase 
in all four Azure nightlies of 2026-09-11 to 2026-09-14, on both 
parameterisations:

    {code}
    java.io.IOException: Failed to delete temp directory 
/tmp/junit12972024642090864369. The following paths could not be deleted (see 
suppressed exceptions for details): 
<jobid>/taskowned/job_<jobid>_tm_<uuid>/0f21e468-f125-4061-9b25-8df6c491141b, 
...
        Suppressed: java.nio.file.NoSuchFileException: 
/tmp/junit12972024642090864369/<jobid>/taskowned/job_<jobid>_tm_<uuid>/0f21e468-f125-4061-9b25-8df6c491141b
    {code}

    https://dev.azure.com/apache-flink/apache-flink/_build/results?buildId=79018
    https://dev.azure.com/apache-flink/apache-flink/_build/results?buildId=79008
    https://dev.azure.com/apache-flink/apache-flink/_build/results?buildId=79000
    https://dev.azure.com/apache-flink/apache-flink/_build/results?buildId=78965

    It is not limited to Azure, the same mode shows up on release-1.20 push 
runs on GitHub Actions:

    https://github.com/apache/flink/actions/runs/33842483755
    https://github.com/apache/flink/actions/runs/33783331299

    release-2.2 and release-2.3 carry the same test without the fix, so they 
are exposed as well.

> 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
>
> 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