mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
gh-106558: break ref cycles through exceptions in multiprocessing manager (#106559)
This commit is contained in:
parent
caa41a4f1d
commit
5f7d4ecf30
3 changed files with 49 additions and 2 deletions
|
@ -90,7 +90,10 @@ def dispatch(c, id, methodname, args=(), kwds={}):
|
|||
kind, result = c.recv()
|
||||
if kind == '#RETURN':
|
||||
return result
|
||||
raise convert_to_error(kind, result)
|
||||
try:
|
||||
raise convert_to_error(kind, result)
|
||||
finally:
|
||||
del result # break reference cycle
|
||||
|
||||
def convert_to_error(kind, result):
|
||||
if kind == '#ERROR':
|
||||
|
@ -833,7 +836,10 @@ class BaseProxy(object):
|
|||
conn = self._Client(token.address, authkey=self._authkey)
|
||||
dispatch(conn, None, 'decref', (token.id,))
|
||||
return proxy
|
||||
raise convert_to_error(kind, result)
|
||||
try:
|
||||
raise convert_to_error(kind, result)
|
||||
finally:
|
||||
del result # break reference cycle
|
||||
|
||||
def _getvalue(self):
|
||||
'''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue