Skip to content

feat(ipc): configure entrypoint shutdown timeout#6521

Open
tmtcam-042 wants to merge 2 commits into
livekit:mainfrom
tmtcam-042:entrypoint-shutdown-timeout
Open

feat(ipc): configure entrypoint shutdown timeout#6521
tmtcam-042 wants to merge 2 commits into
livekit:mainfrom
tmtcam-042:entrypoint-shutdown-timeout

Conversation

@tmtcam-042

@tmtcam-042 tmtcam-042 commented Jul 22, 2026

Copy link
Copy Markdown

Summary

The job process currently waits for the entrypoint for a hard-coded 15 seconds during shutdown before cancelling it. This makes that grace period configurable through ServerOptions and AgentServer while preserving the existing 15-second default.

Setting entrypoint_shutdown_timeout=0.0 cancels the entrypoint immediately, allowing applications to terminate active calls without waiting for voice playout or other entrypoint work to drain. Shutdown callbacks continue to run after cancellation.

Closes #6512.

Changes

  • add entrypoint_shutdown_timeout to ServerOptions, AgentServer, and update_options
  • pass the setting through ProcPool to process and thread job executors
  • use the configured timeout when waiting for the job entrypoint during shutdown
  • cover the default, option forwarding, updates, and immediate-cancellation behavior

Testing

  • uv run pytest tests/test_ipc.py tests/test_worker_config.py --unit -q — 26 passed
  • make check — formatting, Ruff, and mypy passed across all 623 source files

@CLAassistant

CLAassistant commented Jul 22, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@tmtcam-042
tmtcam-042 marked this pull request as ready for review July 23, 2026 02:45
@tmtcam-042
tmtcam-042 requested a review from a team as a code owner July 23, 2026 02:45

@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.

Allow configuring the job entrypoint shutdown grace period

2 participants