Explain Linux inotify quota exhaustion when creating the network status watcher
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
Línea de trabajo
Start with crates/icp-app/src/network/managed/launcher.rs, especially wait_for_single_line_file and spawn_network_launcher, and trace native watcher construction before cmd.spawn(). Reproduce allocation failures by simulating native EMFILE and ENOSPC at watcher construction; verify diagnostics distinguish inotify instance quota, process FD limit, and watch quota, report useful limits, and spawn no child. Confirm normal startup and WSL watcher behavior remain intact.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
On 2026-10-11, Toko Miner's local network startup with published ICP CLI 1.6.0 failed with:
Error: failed to watch status directory
Caused by:
0: failed to watch file changes at path /tmp/.tmp6fJ6SO
1: Too many open files (os error 24)
The machine's fs.inotify.max_user_instances was 128, fs.inotify.max_user_watches was 1048576, and the invoking shell's soft/hard RLIMIT_NOFILE was 1048576. A separate small Python process reproduced inotify_init1(O_CLOEXEC) == -1 with errno EMFILE (24). This isolates exhausted per-user inotify instances rather than the shell's process descriptor limit. Editor/desktop processes held many watchers; there is no evidence that ICP leaks them. The watch-reference count is not a unique-instance count and is not used to establish the diagnosis.
Inspected released source: v1.6.0, commit 18435e1747162447fca231548b74d97e4cf48888, crates/icp-app/src/network/managed/launcher.rs, especially wait_for_single_line_file and spawn_network_launcher. The native notify::recommended_watcher is required alongside PollWatcher. Status watcher construction precedes cmd.spawn(), so this specific refusal occurs before spawning the launcher. The user-supplied log selected icp-cli-network-launcher v16.0.0-2026-09-18-03-28; launcher stdout/stderr were empty. No sibling source was used or modified.
Application impact: the build completed, then the explicit destructive local-reset flow deleted disposable local state before ICP startup hit this quota. We are adding an ephemeral allocation/watch probe before compilation and immediately before deletion, and documenting host remediation. The probe cannot reserve capacity across subsequent work. No host limit was changed or destructive reset retried during diagnosis. Application checkout: dragginzgame/toko-miner commit 3e53fb5b8963c126edf9d236f86c71c0a2f335cc, dirty local launcher fixes and concurrent lockfile edits, not a clean released-source qualification.
Reproduction on an already affected Linux host (does not allocate many watchers or alter limits):
cat /proc/sys/fs/inotify/max_user_instances
cat /proc/sys/fs/inotify/max_user_watches
ulimit -Sn
python3 - <<'PY'
import ctypes, os
libc = ctypes.CDLL(None, use_errno=True)
fd = libc.inotify_init1(os.O_CLOEXEC)
print('fd:', fd, 'errno:', ctypes.get_errno() if fd < 0 else 0)
if fd >= 0:
os.close(fd)
PY
Requested outcome: a Linux-specific resource diagnostic for native watcher allocation failures which names both possible EMFILE causes (per-user inotify instance quota and process FD limit), reports useful limits, and documents administrator remedies without changing host configuration or killing unrelated processes. ENOSPC should identify the watch quota separately. A lightweight upstream capacity-check surface would also help consumers admit destructive local workflows before deleting state. This is a diagnostics/documentation request, not a confirmed launcher defect or a request to introduce a silent polling fallback.
Acceptance: simulate native EMFILE and ENOSPC at watcher construction, assert accurate actionable diagnostics and no spawned child; keep normal startup and WSL watcher behaviour intact. Distinguish failed allocation before spawn from launcher crashes. Search of all open/closed issues for inotify, failed to watch, and Too many open files found no matching report.
Linux errno semantics: https://www.man7.org/linux/man-pages/man2/inotify_init.2.html
- Lenguaje dominante
- Rust
- Estrellas
- 115
- Forks
- 14
- Merge medio
- 19 h 57 min
- PR fusionados (30 d)
- 33
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de dfinity/icp-cli
-
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
sync plugin OOMs ("memory allocation of N bytes failed") when the target canister already has assetsAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
dfinity/icp-cli#703 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
question
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
Los mantenedores suelen responder en 1 día
Todos los issues de dfinity/icp-cli
Issues similares
-
agent:triaged bug bughunt pm:bundler priority:p1
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
SocketDev/socket-patch#1573 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
rustix::termios::Termios::OutputModes does not expost some const e.g. OLCUC for musl and macOSAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
bytecodealliance/rustix#1706 · 1 comentario ·
Los mantenedores suelen responder en 11 días
-
`LazyFrameRemote` and `ExecuteRemote` sinks do not accept `Path`, like `LazyFrame` sinks do.Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
-
Bump anybuf version to ^1.0.0Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
wormhole-foundation/wormhole#5062 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día