From 154882dea80b0760cbbb09ffedd4e2accc9d7a21 Mon Sep 17 00:00:00 2001 From: Michael Chin Date: Tue, 16 Jul 2024 18:55:38 -0700 Subject: [PATCH 1/2] Improve %reset status information on timeout --- src/graph_notebook/magics/graph_magic.py | 26 ++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/graph_notebook/magics/graph_magic.py b/src/graph_notebook/magics/graph_magic.py index ec312d1e..7410d8af 100644 --- a/src/graph_notebook/magics/graph_magic.py +++ b/src/graph_notebook/magics/graph_magic.py @@ -1724,15 +1724,29 @@ def on_button_delete_clicked(b): with interval_output: print(f'checking status in {time_remaining} seconds') time.sleep(1) - with output: + with (output): job_status_output.clear_output() interval_output.close() total_status_wait = max_status_retries * poll_interval - print(result) - if interval_check_response.get("status") != 'healthy': - print(f"Could not retrieve the status of the reset operation within the allotted time of " - f"{total_status_wait} seconds. If the database is not in healthy status after at least 1 " - f"minute, please try the operation again or reboot the {message_instance}.") + final_status = interval_check_response.get("status") + if using_db: + if final_status != 'healthy': + print(f"Could not retrieve the status of the reset operation within the allotted time of " + f"{total_status_wait} seconds. If the database is not in healthy status after at " + f"least 1 minute, please try the operation again or reboot the cluster.") + print(result) + else: + if final_status == 'RESETTING': + print(f"Reset is still in progress after the allotted wait time of {total_status_wait} " + f"seconds, halting status checks. Please use %status to verify when your graph is " + f"available again.") + print(f"\nTIP: For future resets, you can use the --max-status-retries option to extend " + f"the total wait duration.") + elif final_status != 'AVAILABLE': + print(f"Graph is not in AVAILABLE or RESETTING status after the allotted time of " + f"{total_status_wait} seconds, something went wrong. " + f"Current status is {final_status}, see below for details.") + print(result) def on_button_cancel_clicked(b): confirm_text_hbox.close() From 293e06d9e5e07ac017210561cda00c866ea0ac83 Mon Sep 17 00:00:00 2001 From: Michael Chin Date: Tue, 16 Jul 2024 19:57:58 -0700 Subject: [PATCH 2/2] update changelog --- ChangeLog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog.md b/ChangeLog.md index 1c8e11cb..d0fb1340 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -3,6 +3,7 @@ Starting with v1.31.6, this file will contain a record of major features and updates made in each release of graph-notebook. ## Upcoming +- Added better `%reset` user messaging on status check timeout ([Link to PR](https://github.com/aws/graph-notebook/pull/652)) - Upgraded `setuptools` dependency to 70.x ([Link to PR](https://github.com/aws/graph-notebook/pull/649)) ## Release 4.5.0 (July 15, 2024)