Commit 0d0fa86
[SPARK-50578][PYTHON][SS][FOLLOWUP] Change to use
### What changes were proposed in this pull request?
This PR change to use `Thread.interrupt()` instead of `Thread.stop()` to attempt to interrupt the execution of `TransformWithStateInPandasPythonPreInitRunner#daemonThread`.
Additionally, logic has been added in `TransformWithStateInPandasStateServer#run` to respond to the interrupt by setting the `CLOSED` state and exiting.
### Why are the changes needed?
The `Thread.stop` method in Java 21 directly throws an `UnsupportedOperationException`, which led to the failure of the Java 21 daily tests:
- https://github.com/apache/spark/actions/runs/12511573912/job/34903859772
- https://github.com/apache/spark/actions/runs/12523542188/job/34933207012
- https://github.com/apache/spark/actions/runs/12592534465/job/35097321533

So the primary purpose of this change is to restore the daily tests for Java 21.
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
- Pass GitHub Actions
- Pass Java 21 GitHub Action test: https://github.com/LuciferYang/spark/actions/runs/12606699142/job/35137180872

### Was this patch authored or co-authored using generative AI tooling?
No
Closes #49354 from LuciferYang/java21-test-2.
Authored-by: yangjie01 <yangjie01@baidu.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>Thread.interrupt instead of Thread.stop to interrupt the execution of TransformWithStateInPandasPythonPreInitRunner#daemonThread1 parent 98dc763 commit 0d0fa86
File tree
2 files changed
+9
-1
lines changed- sql/core/src/main/scala/org/apache/spark/sql/execution/python
2 files changed
+9
-1
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
278 | | - | |
| 278 | + | |
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
| |||
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
149 | 152 | | |
150 | 153 | | |
151 | 154 | | |
| |||
159 | 162 | | |
160 | 163 | | |
161 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
162 | 170 | | |
163 | 171 | | |
164 | 172 | | |
| |||
0 commit comments