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

ForkingServer hang #15

tomerfiliba opened this Issue Mar 2, 2011 · 1 comment


None yet
1 participant

tomerfiliba commented Mar 2, 2011

mman Show activity 3/1/10
Hello all,
I'm using the ForkingServer and I have noticed that the server-side
when a client disconnects. Looking through the code I found that the
handler inside the ForkingServer class needs some checks. Below is a
that fixes the problem. Tomer, feel free to include this in the rpyc
I'm using python 2.6.4 here.

diff -ur rpyc-3.0.7-py2.6/utils/
--- rpyc-3.0.7-py2.6/utils/    2009-09-22 14:38:28.000000000
+++ 2010-03-01 12:44:36.000000000
@@ -202,11 +202,15 @@
     def _handle_sigchld(signum, unused):
             while True:
-                os.waitpid(-1, os.WNOHANG)
+                r = os.waitpid(-1, os.WNOHANG)
+                print "waitpid returned %s" % repr(r)
+                if r == (0, 0):
+                    time.sleep(1)
+                else:
+                    print "our child %d terminated" % r[0]
+                    break
         except OSError:
-        # re-register signal handler (see man signal(2), under
-        signal.signal(signal.SIGCHLD, self._handle_sigchld)

     def _accept_method(self, sock):
         pid = os.fork()

This comment has been minimized.


tomerfiliba commented Mar 2, 2011

fixes a28b882; closed by 7eb48a4; closed by 7eb48a4; closed by 7eb48a4; closed by 7eb48a4; closed by 7eb48a4; closed by 7eb48a4;

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment