Commit c7b3d39
committed
gh-83371: handle exceptions from user-supplied callbacks in process pools
User-supplied callbacks are called from an internal pool management thread. At
present any exceptions they raise are not caught and so propagate out and kill
the thread. This then causes problems for subsequent pool operations, including
joining the pool hanging.
As a QoL improvement, catch and handle any such exceptions using the system
exception hook. Thus by default details of the exception will be printed to
stderr, but the pool's integrity will remain intact.1 parent 8a00c9a commit c7b3d39
1 file changed
+12
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
776 | 777 | | |
777 | 778 | | |
778 | 779 | | |
779 | | - | |
| 780 | + | |
780 | 781 | | |
781 | | - | |
| 782 | + | |
782 | 783 | | |
783 | 784 | | |
784 | 785 | | |
785 | 786 | | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
786 | 794 | | |
787 | 795 | | |
788 | 796 | | |
| |||
813 | 821 | | |
814 | 822 | | |
815 | 823 | | |
816 | | - | |
| 824 | + | |
817 | 825 | | |
818 | 826 | | |
819 | 827 | | |
| |||
825 | 833 | | |
826 | 834 | | |
827 | 835 | | |
828 | | - | |
| 836 | + | |
829 | 837 | | |
830 | 838 | | |
831 | 839 | | |
| |||
0 commit comments