teeny-request: the timeout option is ignored since 10.0.0 (node-fetch 3 has no timeout option)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 63/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- javascript, node.js
- Área
- networking
Línea de trabajo
Start at requestToFetchOptions, where reqOpts.timeout is copied into node-fetch 3 options that no longer honor it; the reproduction script in the issue is the test to run, and done means the callback fires after ~1000 ms with a timeout error instead of hanging. Run it against the installed teeny-request build before changing anything to confirm the regression. Heed the issue's caveat that a blanket AbortSignal.timeout would truncate streaming downloads, so inspect the streaming path and decide between a signal and an agent socket idle timeout.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Library name
teeny-request
Versions
teeny-request 11.0.1 (also 10.x), node-fetch 3.3.2, Node.js 22.22.1
Description
requestToFetchOptions copies reqOpts.timeout into the node-fetch options. node-fetch 3 removed the timeout option, so the value is silently ignored, and a request to a server that never responds waits forever.
This is a regression from teeny-request 10.0.0, which moved from node-fetch 2 to node-fetch 3. With teeny-request 9.0.0 (node-fetch 2.7.0), the same request fails after the timeout.
It affects every library that passes timeout to teeny-request. For example, @google-cloud/storage sets timeout: 60000 as a default for all requests (nodejs-common/util.js). Since storage 8.0.1, which depends on teeny-request ^11, that timeout has no effect.
Reproduction
const http = require('node:http')
const { teenyRequest } = require('teeny-request')
// The server accepts the request and never sends response headers.
const server = http.createServer(() => {})
server.listen(0, () => {
const url = `http://127.0.0.1:${server.address().port}/`
const startedAt = Date.now()
teenyRequest({ uri: url, timeout: 1000 }, (err) => {
console.log(`callback after ${Date.now() - startedAt} ms:`, err?.message)
process.exit(0)
})
setTimeout(() => {
console.log(`no callback after ${Date.now() - startedAt} ms`)
process.exit(1)
}, 5000)
})
Output with teeny-request 11.0.1 (node-fetch 3.3.2):
no callback after 5010 ms
Output with teeny-request 9.0.0 (node-fetch 2.7.0):
callback after 1003 ms: network timeout at: http://127.0.0.1:50922/
Expected behavior
The request fails after about 1000 ms, as it does with teeny-request 9.x.
One possible fix is to pass signal: AbortSignal.timeout(reqOpts.timeout) to fetch. That limits the total request time, which would cut off long streaming downloads, so streaming requests may need a socket idle timeout on the agent instead. In node-fetch 2, the timeout stopped at the response headers for a streamed body.
Related: #9515 (a stalled @google-cloud/storage download never errors).
- Lenguaje dominante
- TypeScript
- Estrellas
- 3.2k
- Forks
- 732
- Merge medio
- 2 d 11 h
- PR fusionados (30 d)
- 99
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de googleapis/google-cloud-node
-
Broken deprecation chainAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
googleapis/google-cloud-node#9854 ·
Los mantenedores suelen responder en 1 día
-
pubsub: "Operation attempted on ended Span" when a modack is flushed after the message was ackedAbiertoapi: pubsub
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
googleapis/google-cloud-node#9853 ·
Los mantenedores suelen responder en 1 día
-
storage: V4 getSignedUrl sorts canonical headers with localeCompare, so they disagree with X-Goog-SignedHeadersPosiblemente ocupada @itsrayeedscodespace la tomó hace 9 días. Abiertoapi: storage
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
googleapis/google-cloud-node#9840 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
firestore: getPartitions() emits gax AutopaginateTrueWarning in every processPosiblemente ocupada @TheRealDanii la tomó hace 13 días. Abiertoapi: firestore
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
googleapis/google-cloud-node#9736 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
googleapis/google-cloud-node#9723 ·
Los mantenedores suelen responder en 1 día
Todos los issues de googleapis/google-cloud-node
Issues similares
-
Type/Improvement
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
OpenNSW/nsw-srilanka#1259 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
oxc-project/tsrs#1010 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Fission-AI/OpenSpec#2260 ·
Los mantenedores suelen responder en 1 día
-
Add: ESP 1 UKAbiertocheck:passed streams:add
Dificultad 1/5 1-3 horas Aptitud para principiantes 64/100
Los mantenedores suelen responder en 1 día
-
area:infra area:storage bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
THU-MAIC/OpenMAIC#2311 · 1 comentario ·
Los mantenedores suelen responder en 1 día