Skip to content

fix: retry connection pool prewarm after failure - #6969

Open
jstar0 wants to merge 1 commit into
livekit:mainfrom
jstar0:fix/connection-pool-prewarm-retry
Open

fix: retry connection pool prewarm after failure#6969
jstar0 wants to merge 1 commit into
livekit:mainfrom
jstar0:fix/connection-pool-prewarm-retry

Conversation

@jstar0

@jstar0 jstar0 commented Aug 24, 2026

Copy link
Copy Markdown

Summary

ConnectionPool.prewarm() records an in-flight task to suppress duplicate work. When that task completes or fails, the task reference was retained, so later prewarm calls permanently skipped the pool even though no prewarm operation was still running.

This change clears the completed task reference before deciding whether to return, allowing a later call to retry after failure or perform a fresh prewarm after completion. The patch is limited to the connection-pool lifecycle and adds a regression for retry-after-failure behavior.

Testing

  • uv run pytest tests/test_connection_pool.py --unit - 7 passed.
  • uv run ruff check livekit-agents/livekit/agents/utils/connection_pool.py tests/test_connection_pool.py - passed.
  • uv run ruff format --check livekit-agents/livekit/agents/utils/connection_pool.py tests/test_connection_pool.py - passed.
  • The core package strict mypy check passed before the final current-main rebase; the repository-wide make check format and lint stages pass on the current head. The repository-wide type stage remains blocked by the existing missing boto3 import in the experimental AWS realtime plugin, outside this patch.
  • git diff --check origin/main...HEAD - passed.

No external provider, LiveKit server, network credential, or integration account is required for this unit-level lifecycle regression.

The submitted commit is SSH-signed with the configured GitHub signing identity.

Compatibility

This is backward compatible. Successful prewarm behavior is unchanged; failed or completed prewarm tasks can now be retried instead of suppressing all future attempts.

@jstar0
jstar0 requested a review from a team as a code owner August 24, 2026 12:52
@CLAassistant

CLAassistant commented Aug 24, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

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.

2 participants