-
-
Notifications
You must be signed in to change notification settings - Fork 30.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiprocessing.Queue created by sub-process fails when used in sub-sub-process ("bad file descriptor" in q.get()) #49405
Comments
(Note: This issue only happens on linux - on Windows things work fine.) Please see the attached script. The script creates a process (TestProcess()). That process runs and Process Process-1:1:
Traceback (most recent call last):
File "/opt/python2.6/lib/python2.6/multiprocessing/process.py", line
231, in _bootstrap
self.run()
File "/opt/python2.6/lib/python2.6/multiprocessing/process.py", line
88, in run
self._target(*self._args, **self._kwargs)
File "queue_test.py", line 7, in TestSubProcess
item = q.get() # Fails with IOError if queue
created in TestProcess
File "/opt/python2.6/lib/python2.6/multiprocessing/queues.py", line
91, in get
res = self._recv()
IOError: [Errno 9] Bad file descriptor If the same queue is created by main (top level), TestSubProcess Tested using: *No problems* Python 2.6.1 (r261:67515, Jan 6 2009, 15:23:19) [GCC 4.2.4 (Ubuntu *Fails on q.get() in TestSubProcess* |
Also reproduced in Python3.0 on OSX 10.5 |
Quick note: Have tracked this down to what appears to be buggy behaviour First invocation of os.pipe() in a Process returns (0,x) - stdin(?) Interactive prompt test follows: >>> import multiprocessing as MP, os
>>> def r(): print os.pipe(), os.pipe(), os.pipe()
...
>>> r()
(9, 10) (11, 12) (13, 14)
>>> MP.Process(target=r).start()
(0, 15) (16, 17) (18, 19)
>>> MP.Process(target=r).start()
(0, 15) (16, 17) (18, 19) |
bpo-5313 seems to be the culprit. |
Patch attached to bpo-5313, please review. |
Committed in r73708 on trunk |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: