@actions/artifact: a non-200 blob response is not destroyed before the retry, so the process waits for the 3-min socket timeout

Ouverte Adaptée aux débutants
#2,575 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
2/5
Temps estimé
1-3 heures
Accessibilité débutants
78/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
github, node.js, typescript
Domaine
backend, devtools

Piste de recherche

Commencez par streamExtractExternal dans le paquet @actions/artifact, où, selon l’issue, une réponse autre que 200 reste ouverte avant la nouvelle tentative. Lisez le traitement des réponses et ses tests, puis reproduisez le cas 404-then-200 avec le mock local décrit dans l’issue. Le travail est terminé lorsque la nouvelle tentative réussit et que le processus se termine rapidement, au lieu d’attendre le délai d’expiration du socket.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

Package: @actions/artifact, as bundled in actions/download-artifact@v8.

What happens.

  1. The first GET of the blob URL gets a non-200 answer (seen with 404 and 503).
  2. streamExtractExternal throws without consuming or destroying the response.
  3. The download retries after 5 s, the retry succeeds, and the step logs success.
  4. The first response's socket stays open. @actions/http-client's default request timeout (req.setTimeout(3 * 60000)) then keeps node alive until it fires, so the step ends about 180 s after the blob request instead of at once.

Reproducer. We used a local mock of the artifact API whose blob URL answers 404 (or 503) once, then 200. We ran download-artifact@v8's dist/index.js with GITHUB_API_URL pointed at the mock:

  • With the one error, it logs Failed to download artifact after 1 retries due to Unexpected HTTP response from blob storage: 404 Not Found, then success, and exits at 180.3 s.
  • With a clean 200, it exits in 0.2 s.

No proxy is involved.

In real runs (self-hosted Linux runners, 181 download steps over 40 workflow runs): the step ran past 60 s 5 times. Each time it ended 181.4 s after its "Redirecting to blob download url" line, and the download itself took about 7.7 s (one failed GET, the 5 s wait, a 1.6 s retry).

Suggested fix. In streamExtractExternal, destroy response.message (or read it to the end) before throwing on a non-200 status, so the failed attempt's socket is released.

Workaround on our side: a 1-min step timeout on the download, then a second try.

Langage dominant
TypeScript
Étoiles
5.9k
Forks
1.8k
Merge moyen
15 min
PR mergées (30 j)
1

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de actions/toolkit

Toutes les issues de actions/toolkit

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.