Repository navigation
Commit c69d79e
committed
fix: Refuse a second cancel, and bound every cancel-token wait
A fourth review found:
- A second cancel_action while the session was CANCELING went through
the cancel handle and returned, ignoring its time limit. The crate's
Session::cancel_action refuses it with InvalidState; the binding now
does the same.
- The unbounded wait for the cancel token could hang for ever when the
caller held a lock that a logging handler on the action thread needs,
since the action thread logs its banner before installing the token.
The wait is now bounded at 20 s from other threads, then raises
"Cannot cancel: the action has not started yet". On the action
thread itself it raises at once, since the token can't appear while
that thread waits.
- dispatch turned a lost wake-up from the action thread into success.
It now raises SessionError "the action thread ended unexpectedly".
Nothing produces that today.
The sessions spec now says not to call an action method or
cancel_action while holding a lock that a logging handler takes on
another thread, since each waits for the action thread, which logs.
Fix stale comments about the runtime-build failure, and keep the
tests' waits under pytest's 30 s limit.
Signed-off-by: Mark Wiebe <399551+mwiebe@users.noreply.github.com>1 parent 16b50ac commit c69d79e
4 files changed
Lines changed: 129 additions & 49 deletions
File tree
- rust-bindings/src/sessions
- specs
- src/openjd
- test/openjd/sessions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
149 | | - | |
150 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
| |||
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
338 | | - | |
339 | | - | |
| 338 | + | |
340 | 339 | | |
341 | 340 | | |
342 | 341 | | |
| |||
505 | 504 | | |
506 | 505 | | |
507 | 506 | | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
508 | 513 | | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
| 514 | + | |
| 515 | + | |
513 | 516 | | |
514 | 517 | | |
515 | 518 | | |
| |||
898 | 901 | | |
899 | 902 | | |
900 | 903 | | |
901 | | - | |
902 | | - | |
903 | | - | |
904 | | - | |
905 | | - | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
906 | 911 | | |
907 | 912 | | |
908 | 913 | | |
| |||
920 | 925 | | |
921 | 926 | | |
922 | 927 | | |
923 | | - | |
924 | | - | |
925 | | - | |
926 | | - | |
927 | | - | |
928 | | - | |
929 | | - | |
930 | | - | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
931 | 937 | | |
932 | 938 | | |
933 | | - | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
934 | 945 | | |
935 | 946 | | |
936 | 947 | | |
| |||
952 | 963 | | |
953 | 964 | | |
954 | 965 | | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
955 | 978 | | |
956 | 979 | | |
957 | 980 | | |
958 | 981 | | |
959 | 982 | | |
960 | | - | |
| 983 | + | |
961 | 984 | | |
962 | 985 | | |
963 | 986 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
235 | 245 | | |
236 | 246 | | |
237 | 247 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2302 | 2302 | | |
2303 | 2303 | | |
2304 | 2304 | | |
2305 | | - | |
2306 | | - | |
2307 | | - | |
2308 | | - | |
2309 | | - | |
| 2305 | + | |
| 2306 | + | |
| 2307 | + | |
| 2308 | + | |
| 2309 | + | |
| 2310 | + | |
| 2311 | + | |
2310 | 2312 | | |
2311 | 2313 | | |
2312 | 2314 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| |||
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
351 | 396 | | |
352 | 397 | | |
353 | 398 | | |
| |||
382 | 427 | | |
383 | 428 | | |
384 | 429 | | |
385 | | - | |
| 430 | + | |
386 | 431 | | |
387 | 432 | | |
388 | 433 | | |
| |||
498 | 543 | | |
499 | 544 | | |
500 | 545 | | |
501 | | - | |
502 | | - | |
503 | | - | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
504 | 549 | | |
505 | 550 | | |
506 | 551 | | |
| |||
0 commit comments