Repository navigation
Conversation
Multi-agent installs keep one SQLite pool per agent, so the common 1024 soft fd cap is the ceiling long before the hard cap matters (TencentCloud#2060): a busy registry baseline sits near the soft cap and tips into an EMFILE storm (92k 'Too many open files' errors in one morning on a 69-agent install). Raise the soft limit toward the hard cap when the foreground server boots; POSIX only, best effort — containers that deny setrlimit log a warning and keep the current limit. Fixes TencentCloud#2060
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Collaborator
|
感谢贡献!本 PR 与 issue #2060(EMFILE)相关,但该问题已由 #2076(“fix: raise fd limits and coalesce accept resource errors”,2026-10-16 08:41 已合入 develop)完整修复,故关闭本 PR。 原因:
建议:如果你确实希望放开到完整 hard cap,可以直接对 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Issue #2060: on a 69-agent install, each agent holds a SQLite pool (~4 fds) for
memory.sqlite, so ~562 fds are baseline against the default 1024 soft NOFILE cap. Slow growth over days tips the process over:[Errno 24] Too many open files×92k,socket.accept() out of system resource×92k, HTTP fully down until restart.The issue's first expected-behavior item: "进程启动时把 soft limit 提到 hard(1048576)或至少高水位".
Fix
octop run(viarun_foreground_blocking, the single foreground entry) now raises the softRLIMIT_NOFILEtoward the hard cap before serving:import resourceguarded; Windows returns immediately — the storm report is from Linux/Docker).setrlimitis denied (hard-limit caps in containers, restricted daemons), log a warning and keep the current limit — boot never fails over this.RLIM_INFINITY, apply a conservative finite floor ofmax(soft, 65535)instead of infinity.Not in this PR (as commented on the issue): SQLite connection reuse/pooling — that lives in octop-memory's per-agent runtime and deserves its own discussion there; and EMFILE backoff on the retry paths, which needs the specific no-backoff loop pinned down first.
Testing
New
tests/unit/launch/test_nofile_limit.py(4 cases, stubbedresourcemodule so they run on any platform):setrlimitcalled with the new pairRLIM_INFINITYhard cap → finite 65535 floorsetrlimitswallowed with a warningruff check/ruff format/mypy --stricton touched files: clean.CHANGELOG
Entry added under
[Unreleased] → 修复.Fixes #2060