Repository navigation
Commit 62d27f8
fix: report a dead child as a crash instead of a 5s timeout
The two Windows failures exposed a reporting bug with a real cost: when the
child died before sending a result, the parent waited out the entire timeout
and then raised EvaluationTimeoutError claiming the evaluation had timed out
by 5 seconds. That was wrong twice over - it stalled the caller for the full
timeout, and it pointed at a timeout when the child had actually crashed.
Found because under 'spawn' (the default on Windows and macOS) multiprocessing
pickles the process arguments in the caller, so a locally defined class in
allowed_vars cannot reach the child. The child then died during bootstrap and
the parent called it a timeout. Two errors in a 20s run surfaced this.
Changes:
- _wait_for_outcome waits for the result, the child's exit or the timeout in
short slices, so a child that dies is noticed immediately. It checks
Process.exitcode rather than is_alive(), because is_alive() joins the process
internally and that blocks until a spawned child finishes bootstrapping - the
same class of hang.
- A child that exits non-zero on its own is reported as a RuntimeError naming
the likely cause (unpicklable allowed_vars/allowed_builtins under spawn).
Exit code -SIGTERM is excluded: that is the parent's own termination, and is
still a genuine timeout.
- process.start() failures from pickling (AttributeError/TypeError/
PicklingError) are converted into a clear RuntimeError instead of leaking a
multiprocessing error.
Tests: a hostile object is never returned or executed (no marker file) and,
under fork, never reduced; a lambda in allowed_vars raises a clear error; a
crashing object fails fast instead of waiting out the timeout. ReduceBomb now
reduces to inert data so the spawn path can be exercised too.
111 tests pass under both fork and a forced spawn. The 0.0.6 payload is still
blocked and the fork/spawn sink probes are unchanged.
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>1 parent 4e5cdeb commit 62d27f8
2 files changed
Lines changed: 146 additions & 36 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
10 | | - | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
167 | 169 | | |
168 | 170 | | |
169 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
170 | 197 | | |
171 | 198 | | |
172 | 199 | | |
173 | 200 | | |
174 | 201 | | |
175 | 202 | | |
| 203 | + | |
| 204 | + | |
176 | 205 | | |
177 | 206 | | |
178 | 207 | | |
| |||
303 | 332 | | |
304 | 333 | | |
305 | 334 | | |
306 | | - | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
307 | 349 | | |
308 | 350 | | |
309 | | - | |
| 351 | + | |
310 | 352 | | |
311 | 353 | | |
312 | 354 | | |
| |||
316 | 358 | | |
317 | 359 | | |
318 | 360 | | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
319 | 380 | | |
320 | 381 | | |
321 | 382 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
26 | 37 | | |
27 | 38 | | |
28 | 39 | | |
29 | 40 | | |
30 | | - | |
| 41 | + | |
31 | 42 | | |
32 | 43 | | |
33 | 44 | | |
| |||
710 | 721 | | |
711 | 722 | | |
712 | 723 | | |
713 | | - | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
714 | 727 | | |
715 | | - | |
716 | | - | |
717 | | - | |
718 | | - | |
719 | | - | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
720 | 737 | | |
721 | 738 | | |
722 | 739 | | |
723 | | - | |
724 | | - | |
725 | | - | |
726 | | - | |
| 740 | + | |
| 741 | + | |
727 | 742 | | |
728 | | - | |
729 | | - | |
730 | | - | |
731 | | - | |
732 | | - | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
733 | 755 | | |
734 | | - | |
735 | | - | |
736 | | - | |
737 | | - | |
738 | | - | |
739 | | - | |
740 | | - | |
741 | | - | |
742 | | - | |
743 | | - | |
744 | | - | |
745 | | - | |
746 | | - | |
747 | | - | |
748 | | - | |
749 | | - | |
750 | | - | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
751 | 800 | | |
752 | 801 | | |
753 | 802 | | |
| |||
0 commit comments