actions / upload-artifact

MIT License
3k stars 683 forks source link

[feat req] Add retries #530

Open JavaScriptBach opened 4 months ago

JavaScriptBach commented 4 months ago

What would you like to be added?

Add internal retries to the action and maybe expose it to the users as a configurable option.

Why is this needed?

Uploading artifacts is flaky and periodically fails. It would be nice if this action was more resilient to transient infrastructure issues.

For example, the most recent flake in my CI pipeline looks like this:

Run actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
With the provided path, there will be 1 file uploaded
Artifact name is valid!
Root directory input is valid!
Beginning upload of artifact content to blob storage
Error: request to https://productionresultssa4.blob.core.windows.net/actions-results/e06d2d77-d1f9-4f1f-8fc5-657fe8515872/workflow-job-run-80b0ee28-5883-5cee-5434-e2ed2a98ab13/artifacts/12bab0cf8a84b33c49b78e313c361ffebcf7[16](https://github.com/VantaInc/obsidian/actions/runs/8010376540/job/21881239313#step:9:17)4e6183662af5cbea955c52f9bf.zip?se=2024-02-22T21%3A15%3A[17](https://github.com/VantaInc/obsidian/actions/runs/8010376540/job/21881239313#step:9:18)Z&sig=drG5LEgNYe8ZOQ1HWmJWKiWMXW9YvRPwdtSjWWrwD%2Bk%3D&sp=cw&spr=https&sr=b&st=[20](https://github.com/VantaInc/obsidian/actions/runs/8010376540/job/21881239313#step:9:21)24-02-22T20%3A15%3A12Z&sv=2021-12-02&comp=block&blockid=YmQ2YzA4YmMtNGM2NC00NzI1LWFmZDMtNDQ5N2VjNzExNjhiMDAwMDAwMDAwMDAw failed, reason: getaddrinfo ENOTFOUND productionresultssa4.blob.core.windows.net
mthaddon commented 3 months ago

One other use case for this is if you have parallelized jobs it's possible that you'd have multiple jobs trying to delete then upload at the same time, and one would pass but the others would fail. We saw this recently with three jobs trying to execute the upload-artifact step at the same time - 1 passed and two failed.