Skip to content

fix: raise fd limits and coalesce accept resource errors - #2076

Merged
Bosheng0422 merged 1 commit into
developfrom
fix/issue-2060-fd-pressure
Oct 16, 2026
Merged

Bosheng0422 merged 1 commit into
developfrom
fix/issue-2060-fd-pressure

Conversation

@Bosheng0422

@Bosheng0422 Bosheng0422 commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Servers launched directly or in Docker can inherit a 1024-fd soft limit. With many agents this leaves too little room for sockets and transient I/O; accept failures then generate repeated tracebacks.

  • Raise the runtime soft NOFILE limit to 65535 within the inherited hard limit, preserve higher limits, and log the effective limits. Failed adjustments warn without blocking startup.
  • Set explicit NOFILE limits in the four shipped Octop Compose definitions.
  • Keep the first accept resource-error traceback per errno and 10-second window, summarize duplicates, and restore the prior event-loop handler on shutdown.

Related issue: #2060 — #2060

Companion connection-management fix: TencentCloud/octop-memory#19. It bounds SQLite connections per backend and shares PostgreSQL business/checkpoint pools across agents (8+4 sessions per process and connection configuration). Raising NOFILE alone does not solve PostgreSQL max_connections. Octop's dependency can be updated after the memory package is released.

Target branch

  • Base is develop

Type of change

  • Bug fix

Test plan

  • make all RUN='uv run --offline --no-sync' PYTEST_JOBS=4: 4765 passed, 32 skipped; format/lint/typecheck passed.
  • Commit hook make precommit: 4766 passed, 66 skipped; dashboard build passed.
  • Added/updated runtime-limit, Compose, startup-order, and accept-error tests.
  • One mocked CPython accept callback with backlog 2048 produces one traceback and one summary for 2047 duplicates.
  • Initial SQLite companion-source integration: 191 passed, 1 skipped.
  • Final PostgreSQL companion-source integration: 95 targeted tests passed, including 6 real PG maintenance tests. With PG max_connections=100 and process NOFILE=1024, 69 actual MemoryRuntime instances plus 8 workers peaked at 12 PG sessions; 30 rebuilds did not increase usage and closing all returned sessions to 0.

Local validation ran on macOS. Linux, Windows and live-test CI checks passed. fnOS hardware has not been directly tested.

Checklist

  • Updated CHANGELOG.md
  • Updated Docker deployment docs

@Bosheng0422
Bosheng0422 merged commit 7c02a8b into develop Oct 16, 2026
3 checks passed
@Bosheng0422
Bosheng0422 deleted the fix/issue-2060-fd-pressure branch October 16, 2026 08:41
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