ERROR:livekit:livekit::rtc_engine::rtc_session:438...
# ask-ai
e
ERRORlivekitlivekit:rtc enginertc session438livekitrtc engine:rtc_session - signal_event taking too much time: Answer(SessionDescription { r#type: "answer", sdp: "v=0\r\no=- 3294127127428296180 1757758006 IN IP4 0.0.0.0\r\ns=-\r\nt=0 0\r\na=msid-semantic:WMS *\r\na=fingerprint:sha-256 0D241CE1B0C10B8AC68A111E7B065710475333D6FCA022471A3EEB4165A08AF1\r\na=ice lite\r\na=extmap allow mixed\r\na=groupBUNDLE 0 1\r\nm=video 9 UDP/TLS/RTP/SAVPF 96\r\nc=IN IP4 0.0.0.0\r\na=setupactive\r\na=mid0\r\na=ice-ufragSoHsYmSQZjROvouy\r\na=ice pwdKEHXpMiiwXwVcqflftCLjRrxHzvpTOtR\r\na=rtcp-mux\r\na=rtcp-rsize\r\na=rtpmap:96 VP8/90000\r\na=rtcp-fb:96 transport-cc \r\na=rtcp-fb:96 ccm fir\r\na=rtcp-fb:96 nack \r\na=rtcp-fb:96 nack pli\r\na=extmap:11 urnietfparamsrtp hdrextsdesrepaired rtp stream id\r\na=extmap12 https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension\r\na=extmap:4 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\na=extmap:9 urnietfparamsrtp hdrextsdesmid\r\na=extmap10 urnietfparamsrtp hdrextsdesrtp stream id\r\na=ridh recv\r\na=rid:q recv\r\na=simulcast:recv h;q\r\na=recvonly\r\nm=application 9 UDP/DTLS/SCTP webrtc-datachannel\r\nc=IN IP4 0.0.0.0\r\na=setupactive\r\na=mid1\r\na=sendrecv\r\na=sctp-port5000\r\na=max message size65535\r\na=ice-ufragSoHsYmSQZjROvouy\r\na=ice pwdKEHXpMiiwXwVcqflftCLjRrxHzvpTOtR\r\n" })
t
Thanks for reaching out, blue. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
It looks like the error "signal_event taking too much time" happens when a signal event handler takes longer than 10 seconds to process an event. This usually occurs because some synchronous or CPU-heavy tasks are blocking the async runtime. Here are a few steps that might help you resolve this: • Try to find any blocking or CPU-intensive tasks in your event handlers and move them to a separate thread using
tokio::task::spawn_blocking
. This can really help keep things running smoothly. • Double-check that there aren’t any unexpected delays in your
await
calls within these handlers. • Take a look at your deployment environment — sometimes CPU throttling can happen, especially on burstable instance types like AWS t3 or t4. Switching to dedicated instances like m5 or c5 might make a big difference in performance consistency. • It could also be helpful to add some instrumentation to track how long your event handlers take to run, so you can spot any operations that are taking longer than expected. If you’d like, I’m here to help you debug this further or walk you through implementing these suggestions. Just let me know! Sources: Voice Assistants | livekit/livekit_composite | DeepWiki | CreateRoom() is Taking Too Long | livekit-api/src/signal_client/mod.rs | Troubleshooting Latency and Timeout Errors with Turn Detection on AWS | livekit-agents/livekit/agents/utils/aio/debug.py
e
can you explain more detail? I am working on local side
t
I completely understand how frustrating the "signal_event taking too much time" error can be when you're working locally. Let’s walk through some steps together to help you get to the bottom of it: 1. Understand the Timeout Mechanism: LiveKit has a 10-second timeout to keep an eye on signal event processing. If an event handler takes longer than this, the system logs the error to keep everything running smoothly. 2. Identify Blocking Operations: - Take a look at your event handlers (like
on_signal_event
) and see if there are any synchronous or heavy CPU tasks. - If you spot any, try moving them to a separate thread using
tokio::task::spawn_blocking
. This way, they won’t hold up the async runtime. 3. Inspect Await Calls: - Double-check that all your
await
calls are truly non-blocking and aren’t causing unexpected delays. 4. Add Instrumentation: - It’s really helpful to add timers or logging to measure how long each event handler takes. This can reveal exactly where things might be slowing down. 5. Optimize Local Environment: - Make sure your local machine has enough CPU and memory to handle the workload. - Also, try to avoid running other heavy processes that could affect LiveKit’s performance. If you’d like, I’m here to help you dig into any specific part of your setup or assist with debugging. Just let me know!
e
INFOapp.api.v1.routes.ai avatar interviewStarting AI interview session for user 1 in room session_1757782187282_p0pz2nqs6 INFOapp.api.v1.routes.ai avatar interviewInterview config: jobTitle='Full Stack Developer' companyName='Full Stack Developer' interviewType='general' duration=30 difficulty='medium' INFOai avatar interviewGROQ_API_KEY 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 INFOai avatar interviewInitializing Simli client... INFOai avatar interviewCreating LiveKit room connection... INFOai avatar interviewGenerating room token... INFOlivekitlivekit_ffi:server133livekit ffi:server - initializing ffi server v0.12.5 INFOlivekitlivekit_ffi:cabi36livekit ffi:cabi - initializing ffi server v0.12.5 INFOai avatar interviewInitializing interview agent with <aiohttp.client.ClientSession object at 0x7b1ef0fa3a50> INFOai avatar interviewAgent initialized with <app.livekit_agent.simli_pipeline_agent.SimliPipelineAgent object at 0x7b1f15834950> INFOai avatar interviewAgent listeners set up with <app.livekit_agent.simli_pipeline_agent.SimliPipelineAgent object at 0x7b1f15834950> INFOai avatar interviewInitializing Simli client... INFO: 127.0.0.1:45594 - "POST /api/v1/ai-avatar-interview/start-interview HTTP/1.1" 200 OK INFO: 127.0.0.1:45594 - "OPTIONS /api/v1/ai-avatar-interview/generate-room-token?room_name=session_1757782187282_p0pz2nqs6 HTTP/1.1" 200 OK INFO: 127.0.0.1:45594 - "POST /api/v1/ai-avatar-interview/generate-room-token?room_name=session_1757782187282_p0pz2nqs6 HTTP/1.1" 200 OK Registering track audio Registering track video INFOaioice.iceConnection(0) Check CandidatePair(('192.168.188.129', 34586) -> ('141.101.90.0', 1473)) State.FROZEN -> State.WAITING INFOaioice.iceConnection(0) Check CandidatePair(('172.17.0.1', 35950) -> ('141.101.90.0', 1473)) State.FROZEN -> State.WAITING INFOaioice.iceConnection(0) Check CandidatePair(('192.168.188.129', 34586) -> ('141.101.90.0', 1473)) State.WAITING -> State.IN_PROGRESS INFOai avatar interviewSending initial silence... INFOai avatar interviewInitializing LiveKit renderer... INFOlivekitlivekit_api:signal clientsignal stream96livekit apisignal client:signal_stream - connecting to wss://navigence-85r0jkqk.livekit.cloud/rtc?sdk=python&amp;protocol=15&amp;auto_subscribe=1&amp;adaptive_stream=0&amp;version=0.19.1&amp;access_token=... INFOaioice.iceConnection(0) Check CandidatePair(('172.17.0.1', 35950) -> ('141.101.90.0', 1473)) State.WAITING -> State.IN_PROGRESS Ping: 0.5121245384216309 INFOaioice.iceConnection(0) Check CandidatePair(('172.17.0.1', 35950) -> ('141.101.90.0', 1473)) nominating pair INFOaioice.iceConnection(0) Check CandidatePair(('172.17.0.1', 35950) -> ('141.101.90.0', 1473)) State.IN_PROGRESS -> State.SUCCEEDED INFOaioice.iceConnection(0) ICE completed SILENT INFOapp.livekit agent.custom livekit rendererConnected to LiveKit room in 7.95s ERRORai avatar interviewError in interview agent: INFOai avatar interviewProvisional close for room session_1757782187282_p0pz2nqs6 ERRORrooterror running user callback for local_track_published: room_handle: 12 local_track_published { track_sid: "TR_VCGSHSUwEiCLfM" } Traceback (most recent call last): File "/home/dev/Projects/NavigenceAI/NavigenceAI/venv/lib/python3.11/site-packages/livekit/rtc/room.py", line 430, in _listen_task self._on_room_event(event.room_event) File "/home/dev/Projects/NavigenceAI/NavigenceAI/venv/lib/python3.11/site-packages/livekit/rtc/room.py", line 480, in _on_room_event lpublication = self.local_participant.track_publications[sid] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^ KeyError: 'TR_VCGSHSUwEiCLfM' Ping: 0.5185990333557129 Ping: 0.5138359069824219 ERRORasyncioTask was destroyed but it is pending! task: <Task pending name='Task-10' coro=<AVSynchronizer._capture_video() running at /home/dev/Projects/NavigenceAI/NavigenceAI/venv/lib/python3.11/site-packages/livekit/rtc/synchronizer.py:103> wait_for=<Future pending cb=[Task.task_wakeup()]>>
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!
e
ERRORasyncioTask was destroyed but it is pending! task: <Task pending name='Task-11' coro=<AVSynchronizer._capture_video() running at /home/dev/Projects/NavigenceAI/NavigenceAI/venv/lib/python3.11/site-packages/livekit/rtc/synchronizer.py:103> wait_for=<Future pending cb=[Task.task_wakeup()]>>