Skip to content
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

bug in ForkingServer #3

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

bug in ForkingServer #3

tomerfiliba opened this issue Mar 2, 2011 · 1 comment
Labels
Bug Confirmed bug

Comments

@tomerfiliba
Copy link
Collaborator

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
Copy link
Collaborator Author

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
Labels
Bug Confirmed bug
Projects
None yet
Development

No branches or pull requests

1 participant