LuciferYang opened a new pull request, #11381: URL: https://github.com/apache/paimon/pull/11381
### Purpose Fixes #11380. "Interrupted CTAS cleans up its table" cancels its job group with `interruptOnCancel = true`. Before Spark 4.0, a kill that lands after the executor's kill check but before `Task.run` records the task thread only marks the TaskContext; the thread is never interrupted, and nothing checks the mark before the task body runs ([SPARK-44818](https://issues.apache.org/jira/browse/SPARK-44818) added that check in 4.0.0). The test UDF then stays in its 30 s `Thread.sleep`, and Range checks the mark only after the partition's 10 rows. The cancelled task holds one of the two `local[2]` slots for up to 300 s, and once both are held, later cases time out waiting for a task to start. The UDF now sleeps in 20 ms steps and throws `TaskKilledException` once the TaskContext is marked killed. When the interrupt does arrive, `Thread.sleep` throws as before. ### Tests The change is test-only. On a fork, with the four cases repeated 40 times per suite on Spark 3.2-3.4 and Scala 2.12, the old UDF left a task running 5 s after `cancelJobGroup` in 4 of 480 cases, and a UDF that polls the mark the same way (with a 200 ms wait before it throws) in none of 480 ([run](https://github.com/LuciferYang/paimon/actions/runs/45150701309)). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
