-
Notifications
You must be signed in to change notification settings - Fork 11
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
Improve task termination #434
Conversation
e0195a1
to
44687dc
Compare
44687dc
to
0fcfc4e
Compare
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'm unsure how this mechanism works. Where is the checking for the flag file done? (I spent 10min looking, but still unclear, sorry!)
0fcfc4e
to
dc165b8
Compare
In addition to attempting to kill the process via its PID, we create a flag file. Before starting the actual test run, the task checks if the flag file still exists. If not, the task terminates. This provides us with an additional mechanism for shutting down the task in its early stage when the PID might not yet have been written to file.
dc165b8
to
892c99a
Compare
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.
Hmm, I don't think this is the correct approach, but it's simple and works... so oti.
The check happens in this line: This is one of the lines we write to the batch file that is executed by the task. This line is placed after the line which writes the PID to file and before the line which executes the test run. When we want to cancel the task, we first delete the flag file and then we additionally try to retrieve the PID and terminate the process. In case the latter doesn't work, the task should still be in its initial phase (before starting the test run) and the removal of the file should make it terminate. I fully agree that this approach is ugly and far from optimal, but I am out of ideas. I tested it and it seemed to to the job. |
In addition to attempting to kill the process via its PID, we create a
flag file. Before starting the actual test run, the task checks if the
flag file still exists. If not, the task terminates.
This provides us with an additional mechanism for shutting down the task
in its early stage when the PID might not yet have been written to file.