Commit 23a73cd
authored
fix: deliver mid-action cancels through SessionCancelHandle (#312)
cancel_action previously failed with 'session is busy' whenever an
action was running, because Session::cancel_action needs &mut Session
and a background action thread owns the Session for exactly that
window - the primary window in which callers want to cancel.
openjd-sessions 0.4.0 introduced Session::cancel_handle(), a
thread-safe handle that delivers a cancel to the in-flight action
without touching the Session, following the action's declared
cancelation method on both the direct and cross-user helper paths.
Obtain the handle at construction and route the taken-session case
through it.
The handle cannot perform the Running -> Canceling state transition
(it does not own the Session), so the snapshot is updated to Canceling
directly, keeping the state visible to Python-side pollers until the
terminal state lands.
Signed-off-by: Sean Tang <171081544+seant-aws@users.noreply.github.com>1 parent a2cc32f commit 23a73cd
1 file changed
Lines changed: 35 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
268 | 273 | | |
269 | 274 | | |
270 | 275 | | |
| |||
360 | 365 | | |
361 | 366 | | |
362 | 367 | | |
| 368 | + | |
363 | 369 | | |
364 | 370 | | |
365 | 371 | | |
| 372 | + | |
366 | 373 | | |
367 | 374 | | |
368 | 375 | | |
| |||
643 | 650 | | |
644 | 651 | | |
645 | 652 | | |
646 | | - | |
647 | | - | |
648 | | - | |
649 | | - | |
650 | 653 | | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
651 | 658 | | |
652 | | - | |
653 | | - | |
654 | | - | |
655 | | - | |
656 | | - | |
657 | | - | |
658 | | - | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
659 | 683 | | |
660 | 684 | | |
661 | 685 | | |
| |||
0 commit comments