-
Notifications
You must be signed in to change notification settings - Fork 84
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
Dynamic deadpool poll time for faster exit detection on linux #148
base: master
Are you sure you want to change the base?
Conversation
…e rapidly. Maybe should update the readme as well? Also removed field cleanlyExitedBeforeProcess that is not set by anyone. Looks like it is a left over from previous versions.
Let's wait with this a bit. Need to investigate some more as seeing weird delays in detecting the exit status on the virtual machine but not real. Hm... |
I've looked why sometimes echo foo took a few ms to complete and sometimes the full poll interval. If I taskset the test program to the same CPU it always takes full poll interval. Here is perf sched timehist
the problem is this
it looks like the following is happening: echo foo closed the streams but gets preempted before exits, aside: this is why I want to have a different name for the threads, ProcessQueue0 is very generic in the report. NuProcessPoller would be more obvious. |
Did a test: Using NuProcess in a loop to do 1000 calls to echo foo, using 1 executor, pinned to 1 cpu core. The case I looked with perf sched. without any code changes the non-blocking blocking Java Standard Library ProcessBuilder took ~3.6 seconds to complete 1000 calls. changing the code for non-blocking with dynamic poll time took around 5.5 seconds to complete. While not as fast as the blocking code, but not too bad. |
Noticed on Linux that sometimes it takes the full
DEADPOOL_POLL_INTERVAL
for the exit to be detected.I think it might make sense to check for exit a lot sooner than
DEADPOOL_POLL_INTERVAL
when detecting a close of a stream.