Skip to content

Catch Timeout exception when stopping endpoints#2128

Merged
LeiGlobus merged 1 commit into
mainfrom
lei/forced-del-err-sc-45767
Jun 4, 2026
Merged

Catch Timeout exception when stopping endpoints#2128
LeiGlobus merged 1 commit into
mainfrom
lei/forced-del-err-sc-45767

Conversation

@LeiGlobus

Copy link
Copy Markdown
Contributor

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

  • Bug fix (non-breaking change that fixes an issue)

@LeiGlobus LeiGlobus force-pushed the lei/forced-del-err-sc-45767 branch from 07bfc07 to 22abb1c Compare May 18, 2026 19:49

@chris-janidlo chris-janidlo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple nits, and one blocker regarding the test.

Comment thread .pre-commit-config.yaml Outdated
Comment thread README.rst
Comment thread changelog.d/20260518_144358_lei_forced_del_err_sc_45767.rst Outdated
Comment thread compute_endpoint/tests/integration/endpoint/endpoint/test_endpoint.py Outdated
@LeiGlobus LeiGlobus force-pushed the lei/forced-del-err-sc-45767 branch 4 times, most recently from f78cdb6 to 6b4ae3c Compare May 28, 2026 17:55
@LeiGlobus LeiGlobus requested a review from chris-janidlo June 1, 2026 19:51
assert tmp_file_content in info_txt


def test_endpoint_psutil_timeout(conf_dir, mocker, ep_uuid):

@chris-janidlo chris-janidlo Jun 3, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last comment got lost, but refactored the test to check for the specific log message, with addition of a few more mocks.

@LeiGlobus LeiGlobus force-pushed the lei/forced-del-err-sc-45767 branch from 6b4ae3c to a0720c1 Compare June 3, 2026 20:05
@LeiGlobus LeiGlobus force-pushed the lei/forced-del-err-sc-45767 branch from a0720c1 to 3ffd77b Compare June 3, 2026 20:13
@LeiGlobus LeiGlobus requested a review from chris-janidlo June 3, 2026 20:13

@chris-janidlo chris-janidlo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

@LeiGlobus LeiGlobus merged commit 0d8b3e5 into main Jun 4, 2026
12 checks passed
@LeiGlobus LeiGlobus deleted the lei/forced-del-err-sc-45767 branch June 4, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants