Commit 6cec3c3
[SPARK-54675][SPARK-54655][SS] Add configurable force shutdown timeout for StateStore maintenance thread pool
### What changes were proposed in this pull request?
This PR introduces a new configuration parameter spark.sql.streaming.stateStore.maintenanceForceShutdownTimeout to control the timeout for force shutdown operations in the StateStore maintenance thread pool.
Previously, the force shutdown timeout was hardcoded to 60 seconds in the MaintenanceThreadPool.stop() method. This PR makes it configurable to allow better control over graceful vs forceful shutdown behavior in different deployment scenarios.
### Why are the changes needed?
Different streaming workloads and operational environments may require different force shutdown timeout values:
- Some environments may need longer timeouts to allow in-flight maintenance operations to complete properly
- Other environments may prefer shorter timeouts to speed up shutdown sequences
- Making this configurable provides operators with more control over the tradeoff between clean shutdown and shutdown speed
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
- Existing tests continue to pass
- The default value maintains backward compatibility with the previous hardcoded behavior
### Was this patch authored or co-authored using generative AI tooling?
No
Closes #53432 from ericm-db/state-store-shutdown-config.
Authored-by: ericm-db <[email protected]>
Signed-off-by: Hyukjin Kwon <[email protected]>1 parent 19a1da9 commit 6cec3c3
File tree
5 files changed
+38
-3
lines changed- sql
- catalyst/src/main/scala/org/apache/spark/sql/internal
- core/src
- main/scala/org/apache/spark/sql/execution/streaming/state
- test/scala/org/apache/spark/sql/execution/streaming/state
5 files changed
+38
-3
lines changedLines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2553 | 2553 | | |
2554 | 2554 | | |
2555 | 2555 | | |
| 2556 | + | |
| 2557 | + | |
| 2558 | + | |
| 2559 | + | |
| 2560 | + | |
| 2561 | + | |
| 2562 | + | |
| 2563 | + | |
| 2564 | + | |
2556 | 2565 | | |
2557 | 2566 | | |
2558 | 2567 | | |
| |||
6921 | 6930 | | |
6922 | 6931 | | |
6923 | 6932 | | |
| 6933 | + | |
| 6934 | + | |
| 6935 | + | |
6924 | 6936 | | |
6925 | 6937 | | |
6926 | 6938 | | |
| |||
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1130 | 1130 | | |
1131 | 1131 | | |
1132 | 1132 | | |
1133 | | - | |
| 1133 | + | |
| 1134 | + | |
1134 | 1135 | | |
1135 | 1136 | | |
1136 | 1137 | | |
| |||
1151 | 1152 | | |
1152 | 1153 | | |
1153 | 1154 | | |
1154 | | - | |
| 1155 | + | |
1155 | 1156 | | |
1156 | 1157 | | |
1157 | 1158 | | |
| |||
1416 | 1417 | | |
1417 | 1418 | | |
1418 | 1419 | | |
| 1420 | + | |
1419 | 1421 | | |
1420 | 1422 | | |
1421 | 1423 | | |
1422 | 1424 | | |
1423 | 1425 | | |
1424 | 1426 | | |
1425 | 1427 | | |
1426 | | - | |
| 1428 | + | |
1427 | 1429 | | |
1428 | 1430 | | |
1429 | 1431 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
43 | 49 | | |
44 | 50 | | |
45 | 51 | | |
| |||
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| 130 | + | |
130 | 131 | | |
131 | 132 | | |
132 | 133 | | |
| |||
433 | 434 | | |
434 | 435 | | |
435 | 436 | | |
| 437 | + | |
436 | 438 | | |
437 | 439 | | |
438 | 440 | | |
| |||
468 | 470 | | |
469 | 471 | | |
470 | 472 | | |
| 473 | + | |
471 | 474 | | |
472 | 475 | | |
473 | 476 | | |
| |||
511 | 514 | | |
512 | 515 | | |
513 | 516 | | |
| 517 | + | |
514 | 518 | | |
515 | 519 | | |
516 | 520 | | |
| |||
578 | 582 | | |
579 | 583 | | |
580 | 584 | | |
| 585 | + | |
581 | 586 | | |
582 | 587 | | |
583 | 588 | | |
| |||
621 | 626 | | |
622 | 627 | | |
623 | 628 | | |
| 629 | + | |
624 | 630 | | |
625 | 631 | | |
626 | 632 | | |
| |||
666 | 672 | | |
667 | 673 | | |
668 | 674 | | |
| 675 | + | |
669 | 676 | | |
670 | 677 | | |
671 | 678 | | |
| |||
787 | 794 | | |
788 | 795 | | |
789 | 796 | | |
| 797 | + | |
790 | 798 | | |
791 | 799 | | |
792 | 800 | | |
| |||
866 | 874 | | |
867 | 875 | | |
868 | 876 | | |
| 877 | + | |
869 | 878 | | |
870 | 879 | | |
871 | 880 | | |
| |||
941 | 950 | | |
942 | 951 | | |
943 | 952 | | |
| 953 | + | |
944 | 954 | | |
945 | 955 | | |
946 | 956 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
| |||
139 | 140 | | |
140 | 141 | | |
141 | 142 | | |
| 143 | + | |
142 | 144 | | |
143 | 145 | | |
144 | 146 | | |
| |||
214 | 216 | | |
215 | 217 | | |
216 | 218 | | |
| 219 | + | |
217 | 220 | | |
218 | 221 | | |
219 | 222 | | |
| |||
291 | 294 | | |
292 | 295 | | |
293 | 296 | | |
| 297 | + | |
294 | 298 | | |
295 | 299 | | |
296 | 300 | | |
| |||
365 | 369 | | |
366 | 370 | | |
367 | 371 | | |
| 372 | + | |
368 | 373 | | |
369 | 374 | | |
370 | 375 | | |
| |||
0 commit comments