-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Fleet] Fix isPackageVersionOrLaterInstalled to check for installed package #176532
[Fleet] Fix isPackageVersionOrLaterInstalled to check for installed package #176532
Conversation
…installed and not installing
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
/ci |
) { | ||
let installType: InstallType; | ||
try { | ||
installType = getInstallType({ pkgVersion, installedPkg: installedPackageObject }); |
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 removed the installType
here as it seems not used by that function consumers, and it seems that function should not return it as it's not creating an install but checking if one exist
Pinging @elastic/fleet (Team:Fleet) |
@elasticmachine merge upstream |
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 good with merging this as-is. Happy with the testing approach here. Thanks for tracking this down.
This can probably get a release note fix label and that should suffice for release notes. |
💚 Build Succeeded
Metrics [docs]
To update your PR or re-run it, just comment with: cc @nchaulet |
Should this be backported to 8.12? |
it touch a part of the code that is a little tricky, and the bug it's fixing is only happening in some scenario of race condition not sure it's worth taking the risk to backport it. |
+1 let's not backport this to be safe. |
Description
Resolve elastic/elastic-agent#4102
Fix isPackageVersionOrLaterInstalled to check for installed package and retry when package is in
installing
statusWork in progress
Test
The changes are unit tested, I do not think it will be easy/usefull to add an api test here as that scenario happen during some race condition.
You can manually test the race condition by introducing a delay in the intallation
How to reproduce the bug I introduce an artificial delay in the package install process
And try to create two agent policy concurently
Todo
isPackageVersionOrLaterInstalled