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
Commit 87da442
Browse filesBrowse the repository at this point in the historyBrowse files
Discovery limits bound what indexing accepts, not what it then costs. A
repository well inside those bounds can still exhaust the host through parser
memory, or simply never finish, and a supervised worker that hangs leaves the
parent waiting with nothing to report.
Add index_max_rss_mb and index_max_duration_seconds, enforced by the parent
against the worker process tree rather than the worker process alone, so a
runaway child cannot hide behind a small parent. Resident memory is sampled
through the platform interface on macOS, Linux and Windows. Crossing a limit
terminates the tree and yields one trusted, structured terminal result that
attributes the failure to the resource that caused it.
Both limits default to off. A measurement that cannot be taken fails the
attempt instead of passing it: a watchdog that quietly stops watching is
worse than no watchdog at all.
The shell fixture that stands in for the supervisor names the two new keys.
The worker accepts only a policy that spells out every key it knows, which is
what keeps a stale supervisor from starting a worker it cannot bound.
Signed-off-by: 刘冲 <mail@liuchong.dev>
Copy file name to clipboardExpand all lines: docs/CONFIGURATION.md
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,6 +91,8 @@ Current keys:
91
91
|`watcher_enabled`|`true`| Master switch for the background watcher subsystem. Set `false` to stop the watcher from starting at all — no poll thread and no project registration. Reindex manually with `index_repository` when disabled. |
92
92
|`index_max_files`|`off`| Optional maximum number of accepted source files in one discovery run. |
93
93
|`index_max_source_mb`|`off`| Optional maximum accepted source size in MiB in one discovery run. |
94
+
|`index_max_rss_mb`|`off`| Optional maximum current RSS in MiB for the complete contained index-worker process tree (`64..1048576`). |
95
+
|`index_max_duration_seconds`|`off`| Optional maximum total worker duration in seconds (`1..86400`). |
94
96
95
97
> **`watcher_enabled` vs `auto_watch`.**`watcher_enabled` controls whether the
96
98
> watcher *subsystem* starts at all (the background poll thread). `auto_watch` is
@@ -118,11 +120,13 @@ Current keys:
118
120
>`auto_index` still runs, and `index_repository` stays available for manual
119
121
> reindexing.
120
122
121
-
The two`index_max_*` settings are independent and disabled by default. They
123
+
The four`index_max_*` settings are independent and disabled by default. They
122
124
apply to explicit indexing, automatic indexing, and watcher re-indexing, but not
123
125
to `cross-repo-intelligence`, which does not scan repository source files.
124
-
Equality is allowed; exceeding either setting fails the complete index request
125
-
and preserves any previously serving database. See
126
+
Equality is allowed; exceeding any setting fails the complete index request and
127
+
preserves any previously serving database. Worker RSS covers descendants and is
128
+
not the same as the internal `CBM_MEM_BUDGET_MB` allocation budget. Total
129
+
duration is independent of the existing 15-minute no-log-progress timeout. See
126
130
[Index resource limits](INDEX_RESOURCE_LIMITS.md) for counting, validation, and
0 commit comments