Commit dd640f5
committed
info-gatherer: fix 'Too many open files' from cpu*4 parallel workers
On a high-core host the info-gatherer runs cpu_count()*4 ProcessPoolExecutor
workers (512 on a 128-core box). Each worker keeps a pipe open in the parent and
forks a piped config-dump subprocess, so the pool exhausts the open-file limit
when it spawns workers (OSError: [Errno 24] Too many open files).
The binding limit is the *container's* RLIMIT_NOFILE, which defaults to ~1024
soft regardless of the host's (often generous) limit — so this bites in Docker
even when a native build is fine. Two complementary fixes:
- docker.sh: pass the HOST's hard nofile into the container via
--ulimit nofile=<hard>:<hard>, so the container matches the host. The host hard
limit never exceeds the kernel's fs.nr_open and the container shares that
kernel, so the value is always a valid --ulimit. Falls back to 1048576 if the
host reports 'unlimited'.
- armbian_utils.py: before building the pool, raise the soft RLIMIT_NOFILE to the
hard limit (best-effort) — fixes native/bare-metal runs with a low soft limit
and is belt-and-suspenders inside the container.
No change to the cpu*4 worker count.
Signed-off-by: Igor Pecovnik <igor@armbian.com>1 parent 84b4f93 commit dd640f5
2 files changed
Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
397 | 397 | | |
398 | 398 | | |
399 | 399 | | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
400 | 412 | | |
401 | 413 | | |
402 | 414 | | |
403 | 415 | | |
404 | 416 | | |
405 | 417 | | |
406 | 418 | | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
407 | 423 | | |
408 | 424 | | |
409 | 425 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
542 | 543 | | |
543 | 544 | | |
544 | 545 | | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
545 | 558 | | |
546 | 559 | | |
547 | 560 | | |
| |||
0 commit comments