Repository navigation
Limit number of processes that can be spawned when fetching manifests - #247
Conversation
I noticed when there are a large number of services (e.g. on i19) and the workstation has limited resources, the command can crash as it can't spawn more subprocesses
|
Warning Review limit reached
Next review available in: 55 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR adds a semaphore to limit concurrent manifest extraction, updates ChangesArgo manifest extraction
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/edge_containers_cli/cmds/argo_commands.py`:
- Around line 305-307: The manifest parsing in the resource loop is brittle
because splitting on raw document separators can drop the first YAML document
and mis-handle `---` inside content. Update the parsing in the `argo` command’s
resource-processing path to use YAML stream/document parsing instead of
`mani_resp.split("---")[1:]`, and ensure each parsed document is validated as a
dictionary before any `.get(...)` access in the `manifest` handling logic.
- Line 32: The module-level asyncio.Semaphore in argo_commands.py should not be
shared across fresh event loops created by _run_async(), since it can become
bound to the first loop and fail on later calls. Move semaphore creation into
_get_service_data(), pass the semaphore through to _extract_app_manifests(), and
keep the concurrency control local to the event loop used for that invocation.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d10333f5-f26c-425a-ad8f-5947e04a46db
📒 Files selected for processing (1)
src/edge_containers_cli/cmds/argo_commands.py
…ly assign based on cpu_count
Line 305 skips the first segment, so valid YAML output without a leading document marker drops the first manifest. Raw splitting can also break on --- inside scalar content, and Line 307 lets truthy non-dict documents reach .get(...). Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/edge_containers_cli/cmds/argo_commands.py`:
- Around line 345-348: The subprocess concurrency limit in argo_commands.py is
still unbounded on large machines because the Semaphore in the cpu-based setup
uses cpus * 5 directly. Keep the existing cpu_count() scaling in the same
initialization block, but add an upper cap to the computed limit so the
semaphore cannot permit excessive concurrent argocd processes; use the existing
cpus and sem symbols to locate and adjust the limit calculation.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: e57df95b-c4fd-4037-8c4f-41edc70bcaa3
📒 Files selected for processing (1)
src/edge_containers_cli/cmds/argo_commands.py
cpus * 5 can still permit hundreds of concurrent argocd processes on high-core machines, which undermines the crash-prevention goal. Keep the CPU scaling, but cap it. Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
|
@coderabbitai help |
|
@coderabbitai review |
ChatThere are 3 ways to chat with CodeRabbit:
CodeRabbit commands
Other keywords and placeholders
CodeRabbit configuration file (
|
✅ Action performedReview finished.
|
I noticed when there are a large number of services (e.g. on i19) and the workstation has limited resources, the command can crash as it can't spawn more subprocesses
Summary by CodeRabbit