-
Notifications
You must be signed in to change notification settings - Fork 15
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
add VEP process management #7
add VEP process management #7
Conversation
sheridancbio
commented
Jun 22, 2020
•
edited
Loading
edited
fc43f00
to
1ca101a
Compare
Process psProcess = psProcessBuilder.start(); | ||
BufferedReader in = new BufferedReader(new InputStreamReader(psProcess.getInputStream())); | ||
while (true) { | ||
String line = in.readLine(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't it equivalent to use:
while ((line = in.readLine()) != null)
...
?
I am hesitant to use true
in the while statement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i suppose the item being parsed would also need to be in the while statement check as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed as you suggested
determineIfKillCommandIsAvailable(); | ||
} | ||
// ReaperDaemonThread | ||
while (true) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hesitant to use true
here as well but at the same time there's a lot going on in this block so maybe just keeping it true
is best to keep it simple?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have fixed this too. The reaper thread, once started, will continue to run as long as the application is running. So now the condition of the while statement checks whether a shutdown of the reaper was requested and exits if it sees such a request.
I have added a servlet configuration bean which will send the request for reaper shutdown as the servlet is exiting ... and will give a few seconds for the reaper to complete its work before exiting the application.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good over all, just had one minor question regarding a couple while
statements
e5f57b6
to
cc1e4d3
Compare
Squashing and updating commit message |
- SystemProcessManager class now provides process management services for VEP - uses UNIXProcess (if available) for determining a Process pid - uses UNIXProcess (if available) for reaping zombies (via waitForProcessExit()) - determines availability of ps and kill commands on local system - manages processes launched if needed tools are available - starts ReaperDaemonThread when first VEP process is launched - reaper will periodically check for orphaned child processes of a destroyed VEP process and kill them - reaper will periodically check for zombie processes and reap them - unix 'ps' command output parsing encapsulated in ProcessSurveyor class - remove thread interruption in VepRunner - now StreamTransferrer threads will exit naturally when orphaned children are killed - shut down reaper as application shuts down Co-authored-by: Manda Wilson <1458628+mandawilson@users.noreply.github.com> Co-authored-by: Robert Sheridan <7747489+sheridancbio@users.noreply.github.com>
680b0c5
to
46168da
Compare