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 de16152
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: 刘冲 <[email protected]>
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
@@ -93,6 +93,8 @@ Current keys:
93
93
|`watch_non_git`|`false`| Also poll project roots that are **not git repositories**. By default the watcher only follows git projects, so a project indexed from a plain directory is never refreshed after its first index — reindex it manually with `index_repository`. Set `true` to poll such roots on the same adaptive cadence with a file-tree scan: the indexer's own discovery walk (same skip lists, `.gitignore` and `.cbmignore` rules) hashed over each file's path, size and mtime. Any change reindexes once; paths the indexer skips (including cbm's own `.codebase-memory/` output) never trigger. The first poll after the daemon starts reindexes each such project once, since nothing records which tree state the index holds. The scan walks the whole tree every poll, so it costs more than git polling on very large trees. Read once when the daemon starts, like `watcher_enabled`. |
94
94
|`index_max_files`|`off`| Optional maximum number of accepted source files in one discovery run. |
95
95
|`index_max_source_mb`|`off`| Optional maximum accepted source size in MiB in one discovery run. |
96
+
|`index_max_rss_mb`|`off`| Optional maximum current RSS in MiB for the complete contained index-worker process tree (`64..1048576`). |
97
+
|`index_max_duration_seconds`|`off`| Optional maximum total worker duration in seconds (`1..86400`). |
96
98
97
99
For a watched project, `index_status` names the polling method in `watch.strategy`:
98
100
`git` (HEAD and dirty-state polling), `tree` (a non-git root polled by the
@@ -126,11 +128,13 @@ has not run yet).
126
128
>`auto_index` still runs, and `index_repository` stays available for manual
127
129
> reindexing.
128
130
129
-
The two`index_max_*` settings are independent and disabled by default. They
131
+
The four`index_max_*` settings are independent and disabled by default. They
130
132
apply to explicit indexing, automatic indexing, and watcher re-indexing, but not
131
133
to `cross-repo-intelligence`, which does not scan repository source files.
132
-
Equality is allowed; exceeding either setting fails the complete index request
133
-
and preserves any previously serving database. See
134
+
Equality is allowed; exceeding any setting fails the complete index request and
135
+
preserves any previously serving database. Worker RSS covers descendants and is
136
+
not the same as the internal `CBM_MEM_BUDGET_MB` allocation budget. Total
137
+
duration is independent of the existing 15-minute no-log-progress timeout. See
134
138
[Index resource limits](INDEX_RESOURCE_LIMITS.md) for counting, validation, and
0 commit comments