Skip to content

fix: raise inotify limits to prevent gateway EMFILE crashes - #182

Merged
KrasimirKralev merged 1 commit into
betafrom
fix/jetson-inotify-limits
Jun 9, 2026
Merged

KrasimirKralev merged 1 commit into
betafrom
fix/jetson-inotify-limits

Conversation

@KrasimirKralev

Copy link
Copy Markdown
Contributor

Problem (#160)

The OpenClaw gateway runs several file watchers β€” skills/workspace, config reload, MEMORY.md. On Jetson the stock inotify ceilings are low (max_user_instances=128, max_user_watches=65536), and under load they exhaust β†’ EMFILE: too many open files during watch setup, which crashes the gateway and drives a restart loop (the reporter saw NRestarts=8 + dbus-daemon: Cannot initialize inotify).

There was no inotify tuning anywhere in scripts//install.sh.

Fix

setup-optimizations.sh now persists higher limits via /etc/sysctl.d/99-clawbox-inotify.conf (instances 512, watches 524288) and applies them. The apply is best-effort and guarded (|| true) so it can't fail the install inside the e2e-install container where /proc/sys is read-only.

Verification

  • bash -n clean.
  • Applied on a real Jetson: limits raised 128 β†’ 512 and 65536 β†’ 524288. (The live box was at 42/128 instances at idle β€” now mitigated.)

Note: this is the device-side mitigation; the watcher-count root cause is upstream OpenClaw.

Closes #160

The OpenClaw gateway runs several file watchers (skills/workspace, config
reload, MEMORY.md). Jetson's stock inotify ceilings (128 instances /
65536 watches) can be exhausted under load and surface as
"EMFILE: too many open files" crashes and gateway restart loops.

Persist higher limits via /etc/sysctl.d/99-clawbox-inotify.conf
(instances 512, watches 524288) in setup-optimizations.sh. The apply is
best-effort and guarded so it can't fail the install inside CI/containers
where /proc/sys is read-only. Verified on a real Jetson: limits raise
from 128/65536 to 512/524288.

Closes #160
@KrasimirKralev
KrasimirKralev requested a review from a team as a code owner June 9, 2026 09:24
@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@KrasimirKralev, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 33 minutes and 32 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

βŒ› How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
βš™οΈ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 40e7cec8-7733-4bf1-bfd9-659b21f06943

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 7f57229 and f4f17a7.

πŸ“’ Files selected for processing (1)
  • scripts/setup-optimizations.sh
✨ Finishing Touches
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/jetson-inotify-limits

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.

❀️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

CI Summary

βœ… Tests

  • Result: passed
  • View run
  • Coverage: statements 69.17%, branches 59.07%, functions 64.01%, lines 71.22%

βœ… E2E

βœ… E2E Install

@KrasimirKralev
KrasimirKralev merged commit cf61356 into beta Jun 9, 2026
7 checks passed
@KrasimirKralev
KrasimirKralev deleted the fix/jetson-inotify-limits branch July 4, 2026 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant