bug in ForkingServer #3

Closed
tomerfiliba opened this Issue Mar 2, 2011 · 1 comment

Projects

None yet

1 participant

@tomerfiliba
Owner

Hi,

I don't know if anybody has reported this.

There is a bug in utils/server.py that prevents the forking server from running.

The bug is in line 209 and can be easily corrected.

It involves ForkingServer.def _handle_sigchld():

@staticmethod 
def _handle_sigchld(signum, unused): 
    try: 
        while True: 
            os.waitpid(-1, os.WNOHANG) 
    except OSError: 
        pass 
    # re-register signal handler (see man signal(2), under Portability) 
    signal.signal(signal.SIGCHLD, self._handle_sigchld) 

The last line uses self, but in a static method self is not available.
Therefore self must be replaced by the class name (ForkingServer).

So the correct version of ForkingServer.def _handle_sigchld() is:

@staticmethod 
def _handle_sigchld(signum, unused): 
    try: 
        while True: 
            os.waitpid(-1, os.WNOHANG) 
    except OSError: 
        pass 
    # re-register signal handler (see man signal(2), under Portability) 
    signal.signal(signal.SIGCHLD, ForkingServer._handle_sigchld) 
@tomerfiliba
Owner

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