Skip to content

[BUG] Race condition when an existing artifact is being fetched right about when new files are added there #1235

Open

Description

@webknjaz

Describe the bug

Sometimes, when an artifact is being updated with new files, the artifact download fails because the API lists those new files as being a part of the artifact but the files themselves haven't yet been made available though the CDN.
The client iterates over the entries, expecting that the files are already downloadable, and crashes when it gets a 404.

See the additional context links to understand the code path that leads to this. But TL;DR — adding HttpCodes.NotFound to

const retryableStatusCodes = [
HttpCodes.BadGateway,
HttpCodes.GatewayTimeout,
HttpCodes.InternalServerError,
HttpCodes.ServiceUnavailable,
HttpCodes.TooManyRequests,
413 // Payload Too Large
]
should fix this.

To Reproduce

Have a few sufficiently big CI matrixes depending on a job creating the initial artifact.
These matrixes should be downloading those artifacts and uploading new files there simultaneously.

You may need to do a number of restarts to hit a race condition when some of the steps that make additional files would add them close in time to the steps in other jobs making artifact downloads.

Expected behavior

Artifact file downloads should re-try on 404 Not Found.

Screenshots

N/A

Additional context

Activity

  1. added
    bug
    on Nov 14, 2022
  2. zdgeorgiev commented on Oct 11, 2023

    @zdgeorgiev

    Any update or workaround for this? Very frustrating..

  3. webknjaz commented on Oct 11, 2023

    @webknjaz
    Author

    I suggest writing to the GitHub's support and asking them to take a look. Or maybe submit a PR with the possible fix to start the discussion? It's infrequent enough that not many people complain, so I can see why they didn't prioritize fixing the annoying bug 🤷‍♂️

  4. webknjaz commented on Dec 19, 2023

    @webknjaz
    Author

    Hey @robherley, may I turn your attention to this bug? I think this is somewhat related to what the recent breaking changes in upload/download actions were attempting to solve, but is not actually fixed.

  5. webknjaz commented on Jan 2, 2024

    @webknjaz
    Author

    @bryanmacfarlane Could you acknowledge that the team knows about this issuw that is tightly connected with what's being reported in relation to the recent loss of stability visible post upgrading to the artifact upload/download actions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions