[Fleet] Check for version conflict errors during package installation #84651
Labels
bug
Fixes for quality problems that affect the customer experience
Feature:EPM
Fleet team's Elastic Package Manager (aka Integrations) project
Team:Fleet
Team label for Observability Data Collection Fleet team
At the start of a package installation, EPM checks if a saved object already exists for a package, and updates it immediately to indicate that an installation is in process. If two processes are trying to install or update a package, this may cause a race condition on the saved object, which results in a
409
error and a failure of the API call.UPDATE: When the two installations are started within about 500ms from each other, the version conflict errors do not happen at the beginning of
_installPackage()
, but somewhere in theinstall*()
functions that are called by_installPackage()
to install the actual assets. This makes this a bit trickier to solve.This task is to handle this situation more gracefully.
A possible approach could be to check for this specific error condition withSavedObjectsClient.errors.isConflictError()
in_install_package()
and react accordingly:read the saved object againcheck again forinstall_status
andinstall_started_at
return early or continue installation accordinglyThe description of #84190 and the script in https://gist.github.com/skh/cc695952031c9e349874b898c7066e42 may be good starting points for this work.
The text was updated successfully, but these errors were encountered: