-
Notifications
You must be signed in to change notification settings - Fork 266
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
base: master
Are you sure you want to change the base?
Conversation
Great PR! Please pay attention to the following items before merging: Files matching
This is an automatically generated QA checklist based on modified files. |
Change the code to not only rely on wait_for_ssh but to polling `is-system-ready`.
a3dfe64
to
9e93106
Compare
@@ -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); |
There was a problem hiding this comment.
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.
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; | ||
} | ||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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) {
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
Change the code to not only rely on wait_for_ssh
Verification run:
sle-15-SP5-Azure-SAP-PAYG-Incidents-x86_64-Build:33599:rpm-SAPHanaSR-ScaleUp-PerfOpt-spn@az_Standard_E8s_v3
Error: waiting for Virtual Machine "Virtual Machine
)sle-15-SP4-HanaSr-Azure-Byos-x86_64-Build15-SP4_2024-05-03T04:03:15Z-hanasr_azure_test_sapconf_msi@64bit
die
and that is not ok http://openqaworker15.qa.suse.cz/tests/282110#step/Crash_site_b-primary/425 🍅