Skip to content

RetryAgent hangs after HTTP/2 stream timeout (UND_ERR_INFO) #5137

@araujogui

Description

@araujogui

Bug Description

RetryAgent with a custom retry callback on an HTTP/2 connection: after a stream timeout (UND_ERR_INFO), calling callback(null) to retry causes client.request()to hang forever, the promise never settles.

Reproducible By

https://github.com/araujogui/undici-5137-bug

Expected Behavior

client.request() rejects after exhausting retries.

Logs & Screenshots

Sending request...
Retrying (attempt 1/3)... error was: HTTP/2: "stream timeout after 3000" [UND_ERR_INFO]
Warning: Detected unsettled top-level await at file:///Users/guilhermearaujo/Projects/araujogui.dev/bid-hunter/repro.ts:34
const { statusCode, body } = await client.request({
                             ^

Environment

  • macOS Darwin 25.3.0
  • Node.js v24.14.0
  • undici 8.1.0

Additional context

The hang is HTTP/2-specific. After UND_ERR_INFO, the connection is in a half-closed state, the retried request is enqueued but never dispatched or rejected. HTTP/1.1 timeouts (UND_ERR_HEADERS_TIMEOUT) do not exhibit this hang.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions