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

Change wait in stop_hana crash #19228

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mpagot
Copy link
Contributor

@mpagot mpagot commented May 2, 2024

Change the code to not only rely on wait_for_ssh

  • Related ticket: TEAM-9215

Verification run:

sle-15-SP5-Azure-SAP-PAYG-Incidents-x86_64-Build:33599:rpm-SAPHanaSR-ScaleUp-PerfOpt-spn@az_Standard_E8s_v3

sle-15-SP4-HanaSr-Azure-Byos-x86_64-Build15-SP4_2024-05-03T04:03:15Z-hanasr_azure_test_sapconf_msi@64bit

Copy link

github-actions bot commented May 2, 2024

Great PR! Please pay attention to the following items before merging:

Files matching lib/**.pm:

  • Consider adding or extending unit tests in t/

This is an automatically generated QA checklist based on modified files.

@mpagot mpagot added the WIP Work in progress label May 2, 2024
Change the code to not only rely on wait_for_ssh
but to polling `is-system-ready`.
@mpagot mpagot force-pushed the crash_stop_hana_wait_ssh branch from a3dfe64 to 9e93106 Compare May 3, 2024 13:08
@mpagot mpagot marked this pull request as ready for review May 3, 2024 13:52
@mpagot mpagot removed the WIP Work in progress label May 3, 2024
@@ -335,18 +335,28 @@ sub stop_hana {
if ($args{method} eq "crash") {
# Crash needs to be executed as root and wait for host reboot
$self->{my_instance}->wait_for_ssh(timeout => $timeout);
Copy link
Contributor

Choose a reason for hiding this comment

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

If I can add a kind suggestion, this call is not clear here if is waiting for some starting system; but in the case the ssh sut is wellknown to be already up in this point, the wait call could even be removed.

Comment on lines +348 to +358
sleep 60;
my $start_time = time();
while ((time() - $start_time) < 60) {
$out = $self->{my_instance}->run_ssh_command(
cmd => "sudo systemctl is-system-running",
timeout => 5,
proceed_on_failure => 1);
last if ($out =~ m/running/);
sleep 10;
}

Copy link
Contributor

@m-dati m-dati May 3, 2024

Choose a reason for hiding this comment

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

I think it not neeed here, you already have it in the next wait_for_ssh call body. May be an explicit ssh start is missing here after down state, instead ?
Try to check the sub softreboot() in instance.pm if could be useful to you.

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean, the full block 348 to 357 IMHO is a duplication, being already executed in L359 wait_for_ssh.

sleep 10;
$out = $self->{my_instance}->wait_for_ssh(timeout => 900);

sleep 60;
Copy link
Contributor

Choose a reason for hiding this comment

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

As we are smartly waiting in the lines below, I'd drop this sleep 60 (and if needed, incorporate the time in the while sentence below as:

my $start_time = time();
whilte ((time() - $start_time) < 120) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"smart wait" in line below is not so smart. It keeps to have trouble with remote VM reboot. This sleep is to hope at least to enter in the while loop when the reboot is at least started.

sleep 10;
}

$out = $self->{my_instance}->wait_for_ssh(timeout => 10);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm with @m-dati here: either we skip using publiccloud::instance::wait_for_ssh in L359 because it causes issues in our scenarios, or we implement something similar as in L348-L358. I don't see the need to keep both.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants