-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
200 processes of salt-master (2016.3.2) #35480
Comments
@jelenak I am only seeing this behavior when restarting the salt-master process. From what I can tell when running Here is my test case: master config:
As shown above even though running Also to clarify I can only reproduce this when having both cachedir setting and worker threads up to about 15-20. |
I can't seem to reproduce this on 2015.8.11 so this seems to be a regression |
Additionally to the PR I've just added there are still 2 more issues:
I've tried to remove it and the error has gone. And by my tests the logging queue shuts correctly without it. @s0undt3ch what do you think about it?
I'll continue to work on this on Monday. |
The fun of signal handling...
|
There are a test issues in #36555. I'll take a look. |
I've analyzed the problem producing the following trace on master shutdown: OSError: [Errno 3] No such process
Traceback (most recent call last):
File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "/usr/lib/python2.7/multiprocessing/util.py", line 321, in _exit_function
p._popen.terminate()
File "/usr/lib/python2.7/multiprocessing/forking.py", line 171, in terminate
os.kill(self.pid, signal.SIGTERM) and implemented another solution that is more correct as I see now. The problem description:
If the logging queue is the first process exited during master shutdown the Implemented fix Do not mix high-level I.e. I've just removed the event-handling children control from Another possible solutions I don't see a significant effect here from the event based mechanism but I may be wrong. To keep the subprocesses management using |
One more note: probably there is a reason to file a bug to python community, at least to see what they will say about it. Here is a simple test reproducing the issue. import multiprocessing
import os
def daemon_main():
print('I\'m a daemon')
if __name__ == '__main__':
print('Starting the daemon')
d = multiprocessing.Process(target=daemon_main)
d.daemon = True
d.start()
print('Waiting children')
ret = os.wait()
print('OS Wait returned: {0}'.format(ret)) The test runs a daemon child with the Starting the daemon
Waiting children
I'm a daemon
OS Wait returned: (27655, 0)
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/usr/lib64/python2.7/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "/usr/lib64/python2.7/multiprocessing/util.py", line 321, in _exit_function
p._popen.terminate()
File "/usr/lib64/python2.7/multiprocessing/forking.py", line 171, in terminate
os.kill(self.pid, signal.SIGTERM)
OSError: [Errno 3] No such process
Error in sys.exitfunc:
Traceback (most recent call last):
File "/usr/lib64/python2.7/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "/usr/lib64/python2.7/multiprocessing/util.py", line 321, in _exit_function
p._popen.terminate()
File "/usr/lib64/python2.7/multiprocessing/forking.py", line 171, in terminate
os.kill(self.pid, signal.SIGTERM)
OSError: [Errno 3] No such process BTW, Python 3 has the issue fixed: at least it doesn't raise the error if the process not found. |
Description of Issue/Question
Steps to Reproduce Issue
Versions Report
The text was updated successfully, but these errors were encountered: