melodic-hamburger-67426
08/12/2025, 6:44 AMtall-airline-16756
08/12/2025, 6:44 AMtall-airline-16756
08/12/2025, 6:44 AMshutdown_process_timeout
in your worker configuration to give the shutdown process a bit more breathing room. For example:
◦ In Python: WorkerOptions(shutdown_process_timeout=120.0)
◦ In JavaScript: new Worker({ shutdownProcessTimeout: 120000 })
1. Optimize shutdown hooks: Double-check that any custom shutdown callbacks finish quickly and avoid heavy operations during shutdown.
2. Analyze shutdown behavior: Take a look at the logs leading up to shutdown to spot any slow spots and make sure all processes and connections are closing properly.
If you want to dive deeper, check out the WorkerOptions documentation and the Job Shutdown Hooks documentation. Hope this helps!melodic-hamburger-67426
08/12/2025, 7:29 AMtall-airline-16756
08/12/2025, 7:29 AMshutdown_process_timeout
in your worker settings. For example:
◦ In Python: WorkerOptions(shutdown_process_timeout=120.0)
◦ In JavaScript: new Worker({ shutdownProcessTimeout: 120000 })
If you want, I’m here to help you with any of these steps—just let me know!
Sources: livekit-agents/livekit/agents/voice/agent_session.py | Tool definition and use | LiveKit Docsmelodic-hamburger-67426
08/12/2025, 7:53 AMtall-airline-16756
08/12/2025, 7:53 AMshutdown()
method:
Inside your job's entrypoint function, just call ctx.shutdown()
to gracefully stop the job. This makes sure all shutdown hooks run and the process exits nicely.
async def entrypoint(ctx):
# Take care of any cleanup
await ctx.shutdown("User initiated shutdown")
2. Using Worker's close()
method:
The Worker class has a handy close()
method that stops all active jobs. It’s perfect if you need to shut down processes from outside.
const worker = new Worker(workerOptions);
// When you want to shut down all jobs
await worker.close();
Feel free to reach out if you want a hand with setting these up or have any other questions!
Sources: Inside a session | LiveKit Docs | Worker | LiveKit Agents | agents/src/worker.tsmelodic-hamburger-67426
08/12/2025, 7:54 AMtall-airline-16756
08/12/2025, 7:55 AM