builder icon indicating copy to clipboard operation
builder copied to clipboard

Race condition in rollout

Open cazala opened this issue 3 years ago • 0 comments

Making a release while the Build and release action is running can cause the rollout to end up using the wrong version.

The problem is:

  1. We use oddish to get the right version for the npm package
  2. We build the webapp using this version as part of the CDN_URL
  3. We use oddish to get the right version and we publish the npm package.

If between 1 and 3, a version of the npm package is published (ie. because another action finished running), then the versions that oddish computes in step 1 and in step 3 are different. This causes the build to be uploaded to the CDN using a different url than the one it was used to build it. Then it's all 404s.

To fix this we should re-use the version we got in step 1 when we do step 3, instead of using oddish again. If there is a race condition, then what would happen is the step 3 is going to fail because a newer version already exists. Which is the right way to handle the race condition, instead of deploying something broken.

cazala avatar Oct 11 '22 18:10 cazala