Jump in `process is unresponsive, killing process` errors
When we upgraded from version 1.2.7 -> 1.2.12, we started seeing process is unresponsive, killing process errors. The upgrade happened without any code changes to our agent. We have never seen this error before.
Sometimes (impossible to reproduce unfortunately), in around 1% of our calls we are seeing the process is unresponsive, killing process error, which crashes the application.
In the process of investigating, we have triple-checked our code for potential synchronous blocking code. We could not find any problem. We had to downgrade to 1.2.7 now to mitigate this problem.
What I see in the logs is always the same (when this error happens):
- Google warning
no candidates in the response - llm node finished
- Agent starts speaking
- TTS Node yielding all audio frames (so this node finishes as well)
- Agent audio cracks (probably in the exact same moment the TTS Node finishes to process the last audio frame)
- Dead silence without possibility to interrupt - dead lock
- after exactly 59 / 60s (this is the ping pong timeout) AFTER the tts node has finished processing the audio we get the
process is unresponsive, killing processerror
Usually the next log should be agent stopped speaking / on_conversation_item_added, but we never see this log. We do not execute any code after the TTS Node.
Screening through some livekit commits in the versions 1.2.8 - 1.2.12 I found this potentially connected commit: https://github.com/livekit/agents/pull/3438/commits
I would suspect that the last audio frame causes an issue, leading to that block.
Even weirder is (see screenshot attached/above) that sometimes the exact same job_id is used to create a new job request. That leads to a "fresh start" right in between the conversation, which causes other problems.
run a SonarQube scan, just to be safe
We've been having a similar issue. In our case, there can be several talk turns in a row where the agent is getting a response from the user and makes successful stt_node, tts_node and llm_node calls, but the agent's audio never makes it to the LiveKit room and the user hear nothing but silence. The process isn't killed until shortly after the use disconnects from the room.
We're seeing this issue in both 1.2.14 and 1.2.5. We're using GPT-4 as the LLM, Deepgram as the STT, and ElevenLabs as TTS with a Cartesia fallback.
We append to transcript files in both an on_conversation_item_added handler and transcription_node handler and upload the files to the cloud in an on_shutdown callback. Is it possible that the blocking function calls in those handlers could cause an issue if file or network I/O is occasionally slower than usual?
We are facing facing exactly same issue
We think we're experiencing this as well.
I'm getting same issue (process is unresponsive, killing process) with livekit-agents==1.2.7
CC: @theomonnom @davidzhao @longcw
+1 seeing this without any other helpful log
same here
We are also seeing the same issue.
process is unresponsive, killing processoccurs because the worker process hits a ping timeout (hardcoded to 60 seconds).
In my case, the issue happened because the model loading took too long, and I resolved it with the following approach.
1. Check your WorkerOptions.num_idle_processes setting
When running in dev mode, it defaults to 0,
and in prod mode, it defaults to min(math.ceil(get_cpu_monitor().cpu_count()), 4).
If you’ve set this value to 2 or higher, try lowering it to 1 — this helps reduce the model initialization overhead time.
2. Use WorkerOptions.prewarm_fnc to preload your model
You can preload the model during the worker initialization phase like this:
def prewarm(proc: JobProcess) -> None:
...
tts = TTS()
# I used a Hugging Face TTS model; load_model() internally calls from_pretrained()
# tts.load_model()
proc.userdata["tts"] = tts
if __name__ == "__main__":
cli.run_app(
worker_options(entrypoint_fnc=entrypoint, prewarm_fnc=prewarm, num_idle_processes=1)
)
In our case, we get this issue in the middle of a voice conversation
https://livekit-users.slack.com/archives/C07FY8WHGPM/p1761196912132379?thread_ts=1759829844.079439&cid=C07FY8WHGPM
I have reported the issue above where we run into this case. Others please also include as much detail as possible.
https://livekit-users.slack.com/archives/C07FY8WHGPM/p1761196912132379?thread_ts=1759829844.079439&cid=C07FY8WHGPM
I have reported the issue above where we run into this case. Others please also include as much detail as possible.
Is that Slack for LiveKit customers? If so, how can I get access to the workspace?
@archfear - yes it is a community slack workspace you can join livekit slack. Workspace url - https://livekit-users.slack.com/
@zaheerabbas-prodigal It looks like you need an @livekit.io email address to join.
sign up using google
@zaheerabbas-prodigal I tried, which is how I got that "The email address must match one of the domains listed below." error in the screenshot.
@archfear - try going through the slack logo link on their documentation page - https://docs.livekit.io/home/ ?
@zaheerabbas-prodigal Thanks! That did the trick. I missed that button.
Hey, this can happen when the event_loop is blocked/stuck. Do you guys have any steps to reproduce this issue? Also make sure to never do any heavy CPU operation on the main thread, as well as using blocking IO
I'll update my event handler functions that are using blocking IO to be async and see if that does the trick. It's been impossible to consistently reproduce this issue.
@theomonnom Did something change recently the would cause unresponsive processes to be killed more frequently? I've only seen it once since rolling back to 1.2.5.