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 bug of possible re-trigger of memory dump #9260

Merged

Conversation

ShellyKa13
Copy link
Contributor

@ShellyKa13 ShellyKa13 commented Feb 16, 2023

Checking the memory dump file path and seeing it already updated indicates that the request dump already occured or in progress we dont want to simply return we want to skip this duplicate call.

What this PR does / why we need it:
This bug was introduced in this commit: f7c1a4c
of refactoring the virt-launcher to use metadata cache instead of libvirt metadata #8820
In it when identifying that the metadata is already updated with the dump path instead of skipping the core dump command it just returned silently.
So in case of calling the virt-launcher memory dump before the status of the memory dump updated on the VM as succeeded caused the core dump command to be called again although dump marked as completed on the VM.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes # This should fix flakiness in test: [sig-storage] VirtualMachineSnapshot Tests [storage-req] With online vm snapshot with memory dump [test_id:8922]should include memory dump in vm snapshot
The tests sometimes fails because a second memory dump is triggered after already marking to the test that the memory dump completed, and so the snapshot was taken and wasn't succeeded in 30 secs since the VM was paused due to the memory dump and couldn't freeze in order to perform the online snapshot.

Special notes for your reviewer:

Release note:

Fix bug of possible re-trigger of memory dump

@kubevirt-bot kubevirt-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. size/M labels Feb 16, 2023
@@ -1186,6 +1186,10 @@ func (l *LibvirtDomainManager) MemoryDump(vmi *v1.VirtualMachineInstance, dumpPa
func (l *LibvirtDomainManager) memoryDump(vmi *v1.VirtualMachineInstance, dumpPath string) error {
logger := log.Log.Object(vmi)

skip := l.shouldSkipMemoryDump(dumpPath)
if skip {
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't

if l.shouldSkipMemoryDump(dumpPath) {
  return nil
}

Work? Not a big deal

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@mhenriks
Copy link
Member

/approve

@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mhenriks

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 17, 2023
Checking the memory dump file path and seeing it already
updated indicates that the request dump already occured or
in progress we dont want to simply return we want to skip
this duplicate call.

Signed-off-by: Shelly Kagan <skagan@redhat.com>
@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Feb 20, 2023
@ShellyKa13
Copy link
Contributor Author

/retest

@kubevirt-bot
Copy link
Contributor

kubevirt-bot commented Feb 20, 2023

@ShellyKa13: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubevirt-fossa fd7c6a2 link false /test pull-kubevirt-fossa

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@kubevirt-commenter-bot
Copy link

/retest-required
This bot automatically retries required jobs that failed/flaked on approved PRs.
Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

2 similar comments
@kubevirt-commenter-bot
Copy link

/retest-required
This bot automatically retries required jobs that failed/flaked on approved PRs.
Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@kubevirt-commenter-bot
Copy link

/retest-required
This bot automatically retries required jobs that failed/flaked on approved PRs.
Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@kubevirt-bot kubevirt-bot merged commit ddae665 into kubevirt:main Feb 20, 2023
@akalenyu
Copy link
Contributor

@ShellyKa13 should we cherrypick this?

@ShellyKa13
Copy link
Contributor Author

yep
/cherrypick release-0.59

@kubevirt-bot
Copy link
Contributor

@ShellyKa13: new pull request created: #9295

In response to this:

yep
/cherrypick release-0.59

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants