You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] swag-ondemand.py infinite loop on Docker daemon restart causes massive log spam and disk exhaustion #1158
When the Docker daemon is upgraded (e.g., via unattended-upgrades), the service restart takes long enough for the /var/run/docker.sock to be removed and recreated. During this window, swag-ondemand.py enters an unthrottled infinite loop, flooding ondemand.log with 502 Bad Gateway / 503 Service Unavailable errors (hundreds per second). This quickly consumes all host disk space, leading to OSError: [Errno 28] No space left on device and triggering a cascading failure of all other containers on the host.
I've verified the code: the issue is located in the run(self) method of ContainerThread class, where the except block executes a logging.exception(e) without any time.sleep(), causing a tight loop that creates hundreds of log entries per second upon connection failure.
Expected Behavior
The script should handle the temporary Docker daemon unavailability gracefully. It should implement a backoff or a delay in the except block of the main loop to prevent log flooding and resource exhaustion during daemon maintenance.
Steps To Reproduce
The issue is specifically reproducible during an automated Docker package upgrade. It is difficult to reproduce with a simple systemctl restart docker as the socket is often replaced fast enough to avoid triggering the sustained 502/503 loop.
Ensure swag-ondemand is running.
Trigger an apt upgrade docker-ce (which performs a full package replacement/restart).
Observe ondemand.log growing at high speed due to the lack of a delay in the exception handler.
Environment
- OS: Ubuntu 24.04.3
- How docker service was installed: Docker's apt repository
This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.
Activity
quietsy commentedon Jul 3, 2026
Thanks for the report, can you provide an example of the log spam?
LinuxServer-CI commentedon Aug 3, 2026
This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.