[Ingest Manager][EPM] Moving reinstall function outside of promise.all #82672
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is to address this issue: #82614
Related fix for 7.10: #82664 (was merged directly to 7.10)
There is a potential for a race condition during the /setup API call if one of the required packages is in the installing state. A required package can get in this state if a failure occurred to install/upgrade that package and we were unable to rollback the package for some reason.
Upon the next call to /setup, if the package can be upgraded, the upgrade code will be initiated in addition to attempting to reinstall the failed package version because both the
ensureInstalledDefaultPackages and the ensurePackagesCompletedInstall calls happen in parallel in the Promise.all.
This PR tries to mitigate that by moving the reinstall functionality outside of the Promise.all so that it is done after the upgrade attempt.
This PR fixes the issue in master and will be backported to 7.x as well.