Skip to content

Termination due to SIGUSR1 is called and process is killed abruptly #4455

@AdarshRai3

Description

@AdarshRai3

Bug Description

These are the logs :

DEFAULT 2026-01-05T15:59:01.559673Z livekit::rtc_engine:470:livekit::rtc_engine - received session close: "server request to leave" Migration Resume
DEFAULT 2026-01-05T15:59:01.559687Z livekit::rtc_engine:470:livekit::rtc_engine - received session close: "signal client closed: \"stream closed\"" UnknownReason Resume
DEFAULT 2026-01-05T15:59:01.560258Z livekit::rtc_engine:766:livekit::rtc_engine - resuming connection... attempt: 0
DEFAULT 2026-01-05T15:59:14.110770Z livekit::rtc_engine::rtc_session:711:livekit::rtc_engine::rtc_session - signal_event taking too much time: Answer(SessionDescription { r#type: "answer", sdp: "v=0\r\no=- 5241511117965315297 1767628744 IN IP4 0.0.0.0\r\ns=-\r\nt=0 0\r\na=msid-semantic:WMS *\r\na=fingerprint:sha-256 3F:79:F5:2C:D2:1C:4C:72:1A:A8:9D:1D:D6:44:E7:EA:CD:26:7E:9F:EC:95:B1:26:48:EE:D7:2D:5B:D8:31:25\r\na=ice-lite\r\na=extmap-allow-mixed\r\na=group:BUNDLE 0 1\r\nm=audio 9 UDP/TLS/RTP/SAVPF 63 111 0 8\r\nc=IN IP4 0.0.0.0\r\na=setup:active\r\na=mid:0\r\na=ice-ufrag:yltvXnSPulzkxXVW\r\na=ice-pwd:swgBSsbYhtKzDSvDPekKSZzBCoIdRJMf\r\na=rtcp-mux\r\na=rtcp-rsize\r\na=rtpmap:63 red/48000/2\r\na=fmtp:63 111/111\r\na=rtpmap:111 opus/48000/2\r\na=fmtp:111 minptime=10;useinbandfec=1;usedtx=1\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\na=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid\r\na=recvonly\r\nm=application 9 UDP/DTLS/SCTP webrtc-datachannel\r\nc=IN IP4 0.0.0.0\r\na=setup:active\r\na=mid:1\r\na=sendrecv\r\na=sctp-port:5000\r\na=max-message-size:65535\r\na=ice-ufrag:yltvXnSPulzkxXVW\r\na=ice-pwd:swgBSsbYhtKzDSvDPekKSZzBCoIdRJMf\r\n", id: 0 })
DEFAULT 2026-01-05T15:59:19.394358Z process exiting
DEFAULT 2026-01-05T16:14:19.386271Z process did not exit in time, killing process
DEFAULT 2026-01-05T16:14:19.386288Z killing process
DEFAULT 2026-01-05T16:14:19.386293Z sending SIGUSR1 signal to process
DEFAULT 2026-01-05T16:14:19.421846Z process exited with non-zero exit code -10

I am using version of livekit version 1.3.10, as you can see from the logs the termination signal is generated from the server which is sending sigusr1 and process is exiting with code zero.

logs are generated from this part of livekit, this file
livekit-agents/livekit/agents/ipc/supervised_proc.py
line 310-317

 if hasattr(signal, "SIGUSR1"):
                try:
                    logger.info("sending SIGUSR1 signal to process", extra=self.logging_extra())
                    os.kill(self._proc.pid, signal.SIGUSR1)  # type: ignore[arg-type]
                    await asyncio.sleep(0.5)
                except Exception:
                    pass
            self._proc.kill()

Kindly give me stable version in which I can switch to resolve this error , I have checked the code for blocker code I cannot find any.

Expected Behavior

Just want agent to not kill process in the middle of the session and call cleanup every time when it terminated by user or self terminate.

Reproduction Steps

1. It is not reproducing every session but in some session , so I cannot reproduce it.
...
- Sample code snippet, or a GitHub Gist link -

Operating System

windows

Models Used

open ai

Package Versions

# -------- LiveKit (VERSION-ALIGNED) --------
    "livekit>=1.0.23",
    "livekit-agents>=1.3.10",
    "livekit-api>=1.1.0",

    # -------- LiveKit Plugins --------
    "livekit-plugins-aws>=1.3.10",
    "livekit-plugins-azure>=1.3.10",
    "livekit-plugins-cartesia>=1.3.10",
    "livekit-plugins-deepgram>=1.3.10",
    "livekit-plugins-google>=1.3.10",
    "livekit-plugins-openai>=1.3.10",
    "livekit-plugins-silero>=1.3.10",
    "livekit-plugins-noise-cancellation>=0.2.5",

Session/Room/Call IDs

No response

Proposed Solution

Additional Context

No response

Screenshots and Recordings

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions