quick-cartoon-22764
03/19/2026, 4:41 PMtall-airline-16756
03/19/2026, 4:41 PMtall-airline-16756
03/19/2026, 4:41 PMshutdown_process_timeout parameter in the agent server options to raise the allowed shutdown time. Increasing this value will give shutdown hooks/webhooks more time before the process is killed.
If you’d like, tell me:
• Whether the webhook is synchronous during shutdown (it waits for a response), and
• How long the webhook currently takes (rough estimate).
I can then suggest a reasonable timeout value and give a short example of moving the webhook call off the shutdown path if you prefer.
Sources: Job lifecycle | LiveKit Documentation | Server startup modes | LiveKit Documentation | Collect recording consent with tasks | LiveKit Documentation, with interactive elementsquick-cartoon-22764
03/19/2026, 4:42 PMtall-airline-16756
03/19/2026, 4:43 PMshutdown_process_timeout.
I can show the exact change, but first a quick clarifying question: are you using a LiveKit agent running with the agent server options in code (for example, starting agents programmatically in Python/Go), or are you deploying via a configuration file / container where you pass options as environment variables or flags? That will determine the exact place to set shutdown_process_timeout.
If you tell me which language or deployment method you’re using (Python, Go, Docker container, Kubernetes, etc.), I’ll provide the precise example and a recommended new value.
, with interactive elementsquick-cartoon-22764
03/19/2026, 4:45 PMtall-airline-16756
03/19/2026, 4:45 PMshutdown_process_timeout when using the Python SDK.
You can set shutdown_process_timeout when constructing the AgentServer. It’s the number of seconds the agent will wait for shutdown callbacks (including webhooks) to finish before forcefully killing the process. The default is 10 seconds.
Example (Python):
from livekit import AgentServer
from livekit.cli import cli
server = AgentServer(
shutdown_process_timeout=30 # increase to 30 seconds (adjust as needed)
)
if __name__ == "__main__":
cli.run_app(server)
Recommendations
• If your shutdown webhook sometimes takes longer than 10s, try 30s–60s to start, then lower if you optimize the webhook.
• Prefer making webhooks asynchronous during shutdown (enqueue background work) so shutdown completes quickly and long tasks don’t delay process exit.
• Measure typical webhook runtime and set the timeout slightly above that to avoid unnecessary forced kills.
If you want, tell me:
• the current webhook runtime (approx), and
• whether the webhook call is synchronous during shutdown.
I can suggest a concrete timeout value and an example pattern to offload webhook work if you’d like.
Sources: Job lifecycle | LiveKit Documentation | Pi Zero Transcriber | LiveKit Documentation, with interactive elements