镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

StreamingTranscriber.connect() hangs indefinitely on failure #136

Closed

Description

@mostafaroshdy1

Summary

I encountered this issue in a high-traffic production environment during a period of DNS instability. When a DNS resolution failed, the process crashed with the following error, but because the connection Promise never rejected, the application was unable to catch or handle the exception gracefully:

uncaughtException: Error: getaddrinfo ENOTFOUND streaming.assemblyai.com

Description

The current implementation of StreamingTranscriber.connect() returns a Promise that only settles (resolves) upon receiving a Begin message. If the connection fails before this message arrives, the Promise remains pending indefinitely.

This creates a "black hole" in the application logic where await transcriber.connect() never completes, making it impossible to handle network issues using standard try/catch blocks or automated retry logic.

The Problem

There are some scenarios where the Promise currently hangs:

  1. DNS/Transport Errors: If a ENOTFOUND or ECONNREFUSED occurs, onerror fires, but the Promise is never rejected.
  2. Premature Closure: If the server drops the connection (e.g., a 4xx/5xx proxy error) before the Begin event, onclose fires, but the Promise stays pending.

Activity

  1. breken-ai commented on Sep 9, 2026

    @breken-ai

    dug into this one - good news: this exact failure mode was fixed in 4.35.0 (june 16, 2026). before that, connect()'s promise executor only captured resolve - onclose and onerror fired the listeners but could never reject, so a dns failure or a pre-Begin close left await transcriber.connect() pending forever. in 4.35.0 connect() was reworked into a connectOnce() attempt with a settled flag: a pre-Begin close now rejects with a StreamingError carrying the close code, a pre-Begin error rejects as retryable, and connect() retries transient failures up to maxConnectionRetries (default 2) with connectionRetryDelay between attempts, while permanent failures like auth reject immediately. upgrade to >=4.35.0 and your try/catch and retry logic will work the way you expected. this one's probably safe to close.

    Built by breken, your AI support engineer - breken.ai finds the bug, proves the fix with unmatched RCA, answers customers in your voice, and keeps your code and support docs clean - this one's on us.

  2. added 3 commits that reference this issue on Sep 20, 2026
    1574e88
    88f072b
    0ad56bc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions