Skip to content

multiprocessing exception: No Child processes #193

@jeffforbes

Description

@jeffforbes

I recently modified the logging in a recent version of websocket.py so that the all of the loggeded information would go to a log file. I am not sure if my changes have caused a recurrence of the multiprocessing exception that was fixed in 2013. This error occurs on a RHEL-5 system with python2.4

Below in the error trace :

2015-08-20 03:00:58,182 exception
Traceback (most recent call last):
File "/opt/websockify/websocket.py", line 977, in start_server
child_count = len(multiprocessing.active_children())
File "/usr/lib64/python2.4/site-packages/multiprocessing/process.py", line 48, in active_children
_cleanup()
File "/usr/lib64/python2.4/site-packages/multiprocessing/process.py", line 58, in _cleanup
if p._popen.poll() is not None:
File "/usr/lib64/python2.4/site-packages/multiprocessing/forking.py", line 106, in poll
pid, sts = os.waitpid(self.pid, flag)
OSError: [Errno 10] No child processes
2015-08-20 03:00:58,182 handler exception: [Errno 10] No child processes

The error only shows up on a busy site which is spawning many child processes.
When this error occurs, the parent process CPU eventually goes to 100% and the log file get filled with these messages. if verbose is off, then only the "OSError: [Errno 10] No child processes" is recorded.

Any ideas what may be causing this exception?

I have modified the code for logging to go to a file.
I changed the reference to self.log_message to self.msg so that the location of the logged messages
would be consistent. I then set up a file handler to replace the streamhandler with a filehandler. I then added a new command line argument to turn on/off the logging to a file. I don't think that these logging changes would affect the multiprocessing module. I can put up a diff if it would be helpful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions