Skip to content

Conversation

@longcw
Copy link
Contributor

@longcw longcw commented Dec 8, 2025

in dev mode with reload enabled, watchfiles will raise a KeyboardInterrupt on SIGTERM, but not sure why the process doesn't exit after KeyboardInterrupt exception, added a force exiting.

@longcw longcw requested a review from a team December 8, 2025 08:07
@chenghao-mou
Copy link
Member

Interestingly, I couldn't reproduce the issue with dev mode, even after changing files multiple times with reload. Any tips?

@longcw
Copy link
Contributor Author

longcw commented Dec 8, 2025

@chenghao-mou it happens if you send a SIGTERM to the process when reload is enabled. are using using iterm2 on mac? if so the reload is disabled, otherwise when you send SIGTERM to the process there should be a log

17:29:21.415 WARNI… watchfiles.main    received signal 15, raising KeyboardInterrupt 

but the process never exit after it

Copy link
Member

@chenghao-mou chenghao-mou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Confirmed the issue and fix with the abovementioned method.

@longcw longcw merged commit 89ffc29 into main Dec 9, 2025
17 of 18 checks passed
@longcw longcw deleted the longc/sigterm-in-dev-mode branch December 9, 2025 01:55
meetakshay99 added a commit to meetakshay99/agents that referenced this pull request Dec 12, 2025
* main: (267 commits)
  AGT-2328: negative threshold in silero (livekit#4228)
  disable interruptions for agent greeting (livekit#4223)
  feature: GPT-5.2 support (livekit#4235)
  turn-detector: remove english model from readme (livekit#4233)
  add keep alive task for liveavatar plugin (livekit#4231)
  feat(warm-transfer): add sip_number parameter for outbound caller ID (livekit#4216)
  fix blocked send task in liveavatar plugin (livekit#4214)
  clear _q_updated right after await to avoid race conditions (livekit#4209)
  ensure playback_segments_count is consistent in the audio output chain (livekit#4211)
  fix inworld punctuation handling (livekit#4215)
  Inference: Rename fallback model name param (livekit#4202)
  fix race condition when stop background audio play handle (livekit#4197)
  fix watchfiles prevent agent prcoess exit on sigterm (livekit#4194)
  feat(google): add streaming support for Gemini TTS models (livekit#4189)
  Add LiveAvatar Stop Session API Call + README Fix (livekit#4195)
  Fallback API for Inference (livekit#4099)
  feat(rime): expand update_options to accept all TTS parameters (livekit#4095)
  mistralai models update (livekit#4156)
  fix record.exc_info is not pickable when using LogQueueHandler (livekit#4185)
  Restore otel chat message (livekit#4118)
  ...
@longcw longcw changed the title fix watchfiles prevent agent prcoess exit on sigterm fix watchfiles prevent agent prcoess exit on SIGTERM Dec 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants