Commit 7be8743
Proxes of shared objects register a Finalizer in BaseProxy._incref(), and it
will call BaseProxy._decref() when it is GCed. This may cause a race condition
with Pool(maxtasksperchild=None) on Windows.
A connection would be closed and raised TypeError when a GC occurs between
_ConnectionBase._check_writable() and _ConnectionBase._send_bytes() in
_ConnectionBase.send() in the second or later task, and a new object
is allocated that shares the id() of a previously deleted one.
Instead of using the id() of the token (or the proxy), use a unique,
non-reusable number.
(cherry picked from commit ba088c8)
Co-authored-by: Petr Viktorin <[email protected]>
Co-authored-by: Akinori Hattori <[email protected]>
1 parent ecda3ae commit 7be8743
File tree
3 files changed
+22
-13
lines changed- Lib/multiprocessing
- Misc
- NEWS.d/next/Library
3 files changed
+22
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
758 | 758 | | |
759 | 759 | | |
760 | 760 | | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
761 | 765 | | |
762 | 766 | | |
763 | 767 | | |
764 | | - | |
765 | | - | |
766 | | - | |
767 | | - | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
768 | 775 | | |
769 | 776 | | |
770 | 777 | | |
771 | | - | |
| 778 | + | |
772 | 779 | | |
773 | | - | |
774 | | - | |
| 780 | + | |
| 781 | + | |
775 | 782 | | |
776 | | - | |
| 783 | + | |
777 | 784 | | |
778 | 785 | | |
779 | 786 | | |
| |||
856 | 863 | | |
857 | 864 | | |
858 | 865 | | |
859 | | - | |
| 866 | + | |
860 | 867 | | |
861 | 868 | | |
862 | 869 | | |
863 | 870 | | |
864 | 871 | | |
865 | | - | |
866 | | - | |
| 872 | + | |
| 873 | + | |
867 | 874 | | |
868 | 875 | | |
869 | 876 | | |
870 | 877 | | |
871 | | - | |
872 | | - | |
| 878 | + | |
| 879 | + | |
873 | 880 | | |
874 | 881 | | |
875 | 882 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
730 | 730 | | |
731 | 731 | | |
732 | 732 | | |
| 733 | + | |
733 | 734 | | |
734 | 735 | | |
735 | 736 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments