Skip to content

fix(tauri): ensure sidecar process is killed when app window is closed#945

Merged
zanllp merged 1 commit into
mainfrom
fix/sidecar-process-cleanup-on-close
Apr 8, 2026
Merged

fix(tauri): ensure sidecar process is killed when app window is closed#945
zanllp merged 1 commit into
mainfrom
fix/sidecar-process-cleanup-on-close

Conversation

@zanllp

@zanllp zanllp commented Apr 8, 2026

Copy link
Copy Markdown
Owner

Previously, the app only sent an HTTP shutdown request to the Python sidecar with no timeout and no fallback. If the request failed, the sidecar process became orphaned, causing memory leaks.

  • Add 3-second timeout to the HTTP shutdown request
  • Add fallback to force-kill the sidecar by PID (taskkill /F /T on Windows, kill -9 on Unix) after HTTP shutdown attempt
  • Store child PID in AppState for use in both window close handler and Tauri command shutdown

Fixes #944

Previously, the app only sent an HTTP shutdown request to the Python
sidecar with no timeout and no fallback. If the request failed, the
sidecar process became orphaned, causing memory leaks.

- Add 3-second timeout to the HTTP shutdown request
- Add fallback to force-kill the sidecar by PID (taskkill /F /T on
  Windows, kill -9 on Unix) after HTTP shutdown attempt
- Store child PID in AppState for use in both window close handler
  and Tauri command shutdown

Fixes #944
@zanllp zanllp merged commit 26e5e36 into main Apr 8, 2026
@zanllp zanllp deleted the fix/sidecar-process-cleanup-on-close branch June 6, 2026 03:54
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.

桌面版软件怎么彻底关闭

1 participant