You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Martijn Visser (Jira)" <ji...@apache.org> on 2026/09/16 09:42:00 UTC
[jira] [Resolved] (FLINK-40446) UnalignedCheckpointRescaleWithMixedExchangesITCase is unstable: @TempDir cleanup races with post-cancel async checkpoint
[ https://issues.apache.org/jira/browse/FLINK-40446?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martijn Visser resolved FLINK-40446.
------------------------------------
Resolution: Fixed
> 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
> Affects Versions: 2.3.0, 2.2.1, 1.20.5
> Reporter: Rui Fan
> Assignee: Rui Fan
> Priority: Major
> Labels: pull-request-available
> Fix For: 2.2.2, 1.20.6, 2.3.1, 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)