[issue47029] Fix a BrokenPipeError when a multiprocessing.Queue is garbage collected
Géry
report at bugs.python.org
Tue Mar 15 14:28:33 EDT 2022
New submission from Géry <gery.ogam at gmail.com>:
A `BrokenPipeError` exception is raised when the queue thread of a `multiprocessing.Queue` still sends enqueued items to the write end of the queue pipe *after* the read end of the queue pipe has been [automatically closed during its garbage collection](https://docs.python.org/3/library/socket.html#socket.socket.close) following the garbage collection of the queue (the write end of the queue pipe is not garbage collected because it is also referenced by the queue thread):
```
import multiprocessing
def main():
q = multiprocessing.Queue()
q.put(0)
if __name__ == '__main__':
main()
```
----------
components: Library (Lib)
messages: 415272
nosy: maggyero
priority: normal
severity: normal
status: open
title: Fix a BrokenPipeError when a multiprocessing.Queue is garbage collected
type: crash
versions: Python 3.10, Python 3.11, Python 3.9
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue47029>
_______________________________________
More information about the Python-bugs-list
mailing list