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

Abierto Apto para principiantes
#2,575 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
78/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
github, node.js, typescript
Área
backend, devtools

Línea de trabajo

Empieza en streamExtractExternal del paquete @actions/artifact, donde, según el issue, una respuesta distinta de 200 queda abierta antes del reintento. Lee el manejo de respuestas y sus pruebas, y después reproduce el caso 404-then-200 con el mock local descrito en el issue. El trabajo estará terminado cuando el reintento tenga éxito y el proceso finalice de inmediato, en lugar de esperar al timeout del socket.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
TypeScript
Estrellas
5.9k
Forks
1.8k
Merge medio
15 min
PR fusionados (30 d)
1

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de actions/toolkit

Todos los issues de actions/toolkit

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.