Repository navigation
tentacle: mgr/rook: don't leak a watcher thread per orchestrator call - #71754
Merged
Merged
Conversation
KubernetesResource spawns a watch thread on the first access to .items, and the thread runs until the watch stream ends. get_osds(), get_resource() and the device fetchers create a KubernetesResource per call, so one describe_service() leaks up to five threads, their HTTPS connections to the apiserver, and the item dicts the threads keep updating. Poll the orchestrator every few seconds and the active mgr accumulates threads until it is OOM-killed. Filter the long-lived rook_pods watch in get_osds() the way describe_pods() does. Convert the other per-call sites to fetch_k8s_items(), a one-shot list call that spawns no watcher. KubernetesResource stays watch-only, for the three long-lived caches in RookCluster. Fixes: https://tracker.ceph.com/issues/78589 Signed-off-by: Kefu Chai <[email protected]> (cherry picked from commit 0c468fe)
travisn
approved these changes
Sep 14, 2026
Contributor
|
This PR has been added to wip-bharath19-testing-20260922.090258-tentacle. |
patsoffice
added a commit
to patsoffice/home-ops
that referenced
this pull request
Sep 30, 2026
Two unrelated leaks were OOMKilling Ceph daemons; five OomKilled alerts fired in the week of 2026-09-22, two of them mons. - Disable the `rook` mgr module. Its get_osds(), get_resource() and device fetchers each build a KubernetesResource per call, leaking a watcher thread and HTTPS connection every time, so orchestrator polling walks the active mgr into its limit (ceph/ceph#71754, not in 20.2.4). Rook reconciles through its CRDs and does not need the module; the cost is `ceph orch` and the dashboard's orchestrator-backed views. - Correct the mgr sizing comment. Re-measured at ~95 MB/day over 30d, about 4x the ~23 MB/day it was tuned for, making 2Gi ~3 weeks of headroom rather than the ~2 months claimed. Limit held at 2Gi on the expectation that disabling the module above removes most of the growth — re-measure before trusting it. - Add an explicit resources.mon block with a 4Gi limit. This is a separate leak: mons do not load mgr modules, and with the cluster HEALTH_OK and every PG active+clean each mon still grows ~55-100 MB/day, hitting the chart's 2Gi default ~4 weeks after it starts. mon-n (1604 -> 2014 MiB over 6 days) and mon-o died that way 16h apart. Requests are left at the chart defaults so scheduling does not change. No tentacle-specific mon leak exists upstream, so 4Gi is mitigation, not a fix. Worth noting the hazard it does not solve: Talos node upgrades restart all three mons within ~30 minutes of each other, resetting the leak clock in lockstep, so they age into the ceiling together rather than one at a time. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This was referenced Nov 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
backport tracker: https://tracker.ceph.com/issues/79959
backport of #70071
parent tracker: https://tracker.ceph.com/issues/78589
this backport was staged using ceph-backport.sh version 16.0.0.6848
find the latest version at https://github.com/ceph/ceph/blob/main/src/script/ceph-backport.sh