Catch Timeout exception when stopping endpoints#2128
Merged
Conversation
07bfc07 to
22abb1c
Compare
chris-janidlo
left a comment
Contributor
There was a problem hiding this comment.
A couple nits, and one blocker regarding the test.
f78cdb6 to
6b4ae3c
Compare
| assert tmp_file_content in info_txt | ||
|
|
||
|
|
||
| def test_endpoint_psutil_timeout(conf_dir, mocker, ep_uuid): |
Contributor
There was a problem hiding this comment.
I still don't think this is testing what we want it to test. There aren't any assertions on what is logged or how we exit, and when playing around with it locally, I see the execution stop on a pidfile check before it gets to the new code in endpoint.py.
Contributor
Author
There was a problem hiding this comment.
Last comment got lost, but refactored the test to check for the specific log message, with addition of a few more mocks.
6b4ae3c to
a0720c1
Compare
stack trace [sc-45767]
a0720c1 to
3ffd77b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
In some situations, when deleting an endpoint, the system utilities package psutil may raise a Timeout Exception when the parent process is still alive 10s after calling parent.terminate().
It isn't trivial to reproduce this error, so this PR attempts to catch the Exception and prints a standard Error message telling the user to try deleting again, a more friendly message.
Addresses [sc-45767]
Type of change