mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-05-09 05:35:30 +02:00
[GH-ISSUE #605] [Bug]: Windows Portable server cleanly shuts down exactly 60 seconds after UI opens (ffmpeg cleanup triggers CTRL_C_EVENT) #388
Labels
No labels
A1
automated
automated
bug
bug
Closed due to inactivity
contrib
dependencies
dependencies
duplicate
enhancement
feedback
hold
invalid
Notes
P1S
pull-request
security
security
ThumbsUp
user-report
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/bambuddy#388
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Reactantvr on GitHub (Mar 4, 2026).
Original GitHub issue: https://github.com/maziggy/bambuddy/issues/605
Originally assigned to: @maziggy on GitHub.
Bug Description
Environment:
Description:
When running the Windows portable version of Bambuddy, the backend server initiates a graceful, unprompted shutdown exactly 60 seconds after opening the web UI.
The logs do not show a crash/traceback; instead, they show a standard termination signal being received right as the camera stream cleanup task is triggered:
Root Cause & Diagnosis:
The issue stems from how Windows handles process termination compared to Linux.
When the UI is opened, ffmpeg is spawned to handle the camera stream. Exactly 60 seconds later,
_camera_cleanup_loop()fires and attempts to clean up orphaned ffmpeg streams.When Python attempts to
.terminate()or.kill()the ffmpeg subprocess on Windows, the OS broadcasts aCTRL_C_EVENTto the entire process group. Uvicorn receives this signal, assumes the user pressed Ctrl+C in the console, and dutifully initiates a graceful shutdown of the entire Bambuddy backend.Confirmed Workaround:
I tested this by modifying
backend\app\main.pyand adding areturnto the top of the_camera_cleanup_loop(around line 2233) to prevent the cleanup from running.With this change, the server survives past 60 seconds and remains stable indefinitely, confirming the cleanup task is the culprit.
Expected Behavior
The backend server should continue running indefinitely while the web UI is open. The background
_camera_cleanup_loop()should quietly terminate orphanedffmpegprocesses without broadcasting aCTRL_C_EVENTto the parent Uvicorn process group that causes the app to quit.Steps to Reproduce
Printer Model
H2C
Bambuddy Version
0.2.1.1
Printer Firmware Version
01.01.00.00
Installation Method
Manual (git clone)
Operating System
Windows
Relevant Logs / Support Package
Screenshots
No response
Additional Context
No response
Checklist
@maziggy commented on GitHub (Mar 4, 2026):
Fixed in branch 0.2.2b2.
If you find Bambuddy useful, please consider giving it a ⭐ on GitHub — it helps others discover the project!