Bug in multiprocessing.reduction?

Kev Dwyer kevin.p.dwyer at gmail.com
Sun Dec 18 03:55:49 EST 2011


Yaşar Arabacı wrote:

> You can see my all code below, theoritically that code should work I
> guess. But I keep getting this error:
> [SUBWARNING/MainProcess] thread for sharing handles raised exception :
> 
-------------------------------------------------------------------------------
> Traceback (most recent call last):
> File "/usr/lib/python2.7/multiprocessing/reduction.py", line 127, in
> _serve send_handle(conn, handle_wanted, destination_pid)
> File "/usr/lib/python2.7/multiprocessing/reduction.py", line 80, in
> send_handle
> _multiprocessing.sendfd(conn.fileno(), handle)
> OSError: [Errno 9] Bad file descriptor
> 
-------------------------------------------------------------------------------
> 
> Do you see an error in my side, or is this a bug in Python?
> 

Hello,

I don't know much about the multiprocessing module, so I won't speculate 
about bugs ;) however I can tell you that your code works with error on my 
machine:

kev at pluto:~> python mtest.py 
[DEBUG/MainProcess] created semlock with handle 140252275732480
[DEBUG/MainProcess] created semlock with handle 140252275728384
[DEBUG/MainProcess] created semlock with handle 140252275724288
[DEBUG/MainProcess] Queue._after_fork()
[DEBUG/Process-1] Queue._after_fork()
[INFO/Process-1] child process calling self.run()
[DEBUG/Process-2] Queue._after_fork()
[INFO/Process-2] child process calling self.run()
[DEBUG/Process-3] Queue._after_fork()
[INFO/Process-3] child process calling self.run()
[DEBUG/Process-4] Queue._after_fork()
[INFO/Process-4] child process calling self.run()
[DEBUG/Process-5] Queue._after_fork()
[INFO/Process-5] child process calling self.run()
[DEBUG/MainProcess] starting listener and thread for sending handles
[INFO/MainProcess] created temp directory /tmp/pymp-J3UxCe
[DEBUG/MainProcess] Queue._start_thread()
[DEBUG/MainProcess] doing self._thread.start()
[DEBUG/MainProcess] starting thread to feed data to pipe
[DEBUG/MainProcess] ... done self._thread.start()
Here <socket._socketobject object at 0x87f980>


"Here" was added to your print line by me.  Otherwise I ran your code as is, 
and sent the string "Hello world" to port 9090 from another console.

Hope that helps,

Kev




More information about the Python-list mailing list