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

fix: TOOLS-3012 standardise error handling string for manage roster #337

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

a-spiker
Copy link
Contributor

@a-spiker a-spiker commented Feb 20, 2025

  • removes special string handling

@a-spiker a-spiker changed the title fix: TOOLS-3012 standard error handling string for manage roster fix: TOOLS-3012 standardise error handling string for manage roster Feb 20, 2025
@@ -2067,7 +2067,7 @@ async def test_info_cluster_stable_with_errors(self):
)

self.info_mock.return_value = "ERROR::unstable cluster"
expected = ASInfoClusterStableError("ERROR::unstable cluster")
expected = ASInfoResponseError("Server returned an error response for info command", "ERROR::unstable cluster")
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks like it would still fail since it would be ERROR:7:unstable cluster

Copy link
Contributor Author

@a-spiker a-spiker Feb 21, 2025

Choose a reason for hiding this comment

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

@kportertx We have removed special string handling with this PR and treated every error generically. With this change, we always handle the Exception, which goes to a happy path where the User can choose what to do next.

Without this change, we were abstracting the Error thrown from the server. Here's a complete experience example.

Admin+> manage roster stage observed ns sc
ERROR: Server returned an error response for info command : unstable cluster.
WARNING: It is advised that you do not manage the roster. Run 'info network' for more information.
You are about to set the pending-roster for namespace sc to: A2, A1, A0
Confirm that you want to proceed by typing x5d8ee, or cancel by typing anything else.
x5d8ee
Pending roster now contains observed nodes.
Run "manage recluster" for your changes to take effect.

Copy link
Contributor Author

@a-spiker a-spiker Feb 21, 2025

Choose a reason for hiding this comment

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

This path was broken due to unstable-cluster -> unstable cluster change from the server where asadm was handling these special strings viz unstable cluster, cluster not specified size

Copy link
Contributor

Choose a reason for hiding this comment

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

K, just looked like this test would still fail.

@@ -2053,7 +2053,7 @@ async def test_info_cluster_stable(self):

async def test_info_cluster_stable_with_errors(self):
self.info_mock.return_value = "ERROR::cluster not specified size"
expected = ASInfoClusterStableError("ERROR::cluster not specified size")
expected = ASInfoResponseError("Server returned an error response for info command", "ERROR::cluster not specified size")
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we directly use INFO_SERVER_ERROR_RESPONSE here rather than the hardcoded string?

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.

3 participants