mirror of
https://github.com/open-webui/terminals.git
synced 2026-11-05 01:37:21 +00:00
[PR #48] [CLOSED] fix: bound reaper sweep concurrency and per-operation time so one hung teardown can't stall it #63
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
open-webui/terminals#63
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?
📋 Pull Request Information
Original PR: https://github.com/open-webui/terminals/pull/48
Author: @Classic298
Created: 7/20/2026
Status: ❌ Closed
Base:
main← Head:claude/reaper-sweep-stall-6tlabg📝 Commits (1)
a1f2fd0fix: bound reaper sweep concurrency and per-operation time so one hung teardown can't stall it📊 Changes
3 files changed (+136 additions, -72 deletions)
View changed files
📝
README.md(+2 -0)📝
terminals/backends/base.py(+132 -72)📝
terminals/config.py(+2 -0)📄 Description
_reap_idle processed every tracked instance in a single sequential, timeout-less pass, and _reaper_loop awaits the full sweep before the next cycle. On large fleets, when a batch of scheduled resets came due at once, one slow or hung Docker/K8s call blocked the await and froze the entire loop with nothing logged — idle reaping and scheduled resets both silently stopped, and containers leaked until the Docker bridge hit its 1024-port cap. Only the provision-path reset kept working, so resets were applied only for reconnecting users.
Split the sweep into a cheap scan that collects due instances, then reap them concurrently under a semaphore (TERMINALS_REAPER_CONCURRENCY, default 8) with a timeout on each teardown/reset call (TERMINALS_REAPER_OP_TIMEOUT_SECONDS, default 120). A timed-out teardown is logged and the instance stays tracked so the next sweep retries it, rather than orphaning a possibly-still-running container. Worst-case sweep duration is now bounded instead of unbounded.
Fixes #46
Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.