Skip to content

Prevent repeated sync streaming connections from leaking sockets - #324

Open
codebanditssss wants to merge 1 commit into
AssemblyAI:masterfrom
codebanditssss:fix/sync-streaming-single-use
Open

codebanditssss wants to merge 1 commit into
AssemblyAI:masterfrom
codebanditssss:fix/sync-streaming-single-use

Conversation

@codebanditssss

Copy link
Copy Markdown

Fixes #321

Reserve the synchronous client before its first WebSocket handshake and reject repeated or concurrent connect calls before another socket is allocated. Preserve retries within the first connect call, clean up owned resources if thread startup fails, and document single-use behavior. Bump the version to 1.10.13 as required by CI.

Validation under Python 3.12 with Pydantic 1.10.26 and 2.12.5:

  • Before: 7 new regressions failed, 1 passed. After: all 8 pass.
  • Full unit suite: 1,042 passed in each environment, with no skips.
  • Tests cover active/disconnected reuse, failed handshakes, concurrent attempts, audio delivery, internal retries, termination, and thread-start failures.
  • Changed-file Ruff/format and whitespace checks pass. Mypy still reports the same 2 pre-existing client errors in each environment; no new diagnostics or suppressions.

Transport boundaries are mocked with real SDK threads. No live API calls were made. The broader Python/tox matrix and service smoke tests were not run.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Repeated synchronous streaming connect calls allocate unowned sockets or silently drop audio

1 participant