Skip to content
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

[Core] Fix status refresh for INIT cluster #2491

Merged
merged 6 commits into from
Aug 31, 2023
Merged

[Core] Fix status refresh for INIT cluster #2491

merged 6 commits into from
Aug 31, 2023

Conversation

Michaelvll
Copy link
Collaborator

@Michaelvll Michaelvll commented Aug 30, 2023

Fixes #2490

Tested (run the relevant ones):

  • Code formatting: bash format.sh
  • Any manual or new tests for this PR (please specify below)
  • All smoke tests: pytest tests/test_smoke.py
  • Relevant individual smoke tests: pytest tests/test_smoke.py::test_fill_in_the_name
  • Backward compatibility tests: bash tests/backward_comaptibility_tests.sh

@Michaelvll Michaelvll added the P0 label Aug 30, 2023
logger.debug(
f'Refreshing status ({cluster_name!r}): failed '
f'to get the ssh ports. Handle: {handle}')
raise exceptions.FetchIPError(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shall we use a new exception named FetchPortError instead?

Copy link
Collaborator Author

@Michaelvll Michaelvll Aug 31, 2023

Choose a reason for hiding this comment

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

Changed to RuntimeError, as this error is only internal facing and should not be raised in most cases, we probably don't want to add a new exception. Wdyt?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sounds good!

Copy link
Collaborator

@cblmemo cblmemo left a comment

Choose a reason for hiding this comment

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

Just tested and it works great for me! Left several nits ;)

raise exceptions.FetchIPError(
reason=exceptions.FetchIPError.Reason.HEAD)

if handle.head_ssh_port is None:
# Refresh the ssh ports. It is ok to refresh as it is fast.
handle.external_ssh_ports()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shall we use update_ssh_ports for better readability?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point! Actually, we don't need to handle this None or refresh case, as we already have it in the external_ssh_ports call. changed to that instead.

logger.debug(
f'Refreshing status ({cluster_name!r}): failed '
f'to get the ssh ports. Handle: {handle}')
raise exceptions.FetchIPError(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sounds good!

@Michaelvll Michaelvll merged commit 11298dc into master Aug 31, 2023
@Michaelvll Michaelvll deleted the fix-ports branch August 31, 2023 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Core] Assertion error when refreshing status for INIT cluster
2 participants