-
Notifications
You must be signed in to change notification settings - Fork 64
[ML] Consider spawning processes from dedicated threads in controller #1503
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
Comments
This is actually trickier than it seems because of the way the |
Further analysis of the problem suggests that it's not the actual elastic/elasticsearch#62823 is probably a more useful change to avoid the problem. I will leave this issue open as it might be useful to revisit in the future, but nobody should work on it in the short term. |
By writing results in an array it's possible to reuse the Java ProcessResultsParser class to read them. Also, making the output thread safe will make implementing elastic#1503 easier if that's ever done.
elastic/elasticsearch#62823 was implemented, so closing this one. |
We have observed that when security software is running on a machine spawning a new process can take a very long time - over 20 seconds has been observed between the command being received in the controller and the resulting posix_spawn call returning. This invalidates the assumption that commands issued to controller by the JVM will be near instantaneous. It causes a problem because the timeout waiting for the named pipes to connect starts immediately after the command is issued, but the process may not actually start until considerably later.
Although spawn times over 20 seconds have been observed, the security software might not be slowing down process spawning that much. Currently
controller
has a single thread for processing commands. If 4 commands to spawn new processes are received in quick succession then they are actioned sequentially at the moment. So if the security software were adding 5 seconds to the time taken to spawn a process then the 4 processes would spawn 5, 10, 15 and 20 seconds after being requested. Effectivelycontroller
is serialising the work of the security software. Instead ifcontroller
created a new thread to process each request to spawn a new process then the security software could do its checks in parallel on all 4 requests.The text was updated successfully, but these errors were encountered: