Skip to content

Fix SQLite FD Exhaustion#493

Merged
pancacake merged 1 commit into
HKUDS:devfrom
thelooter:fix/fd-exhaustion
May 29, 2026
Merged

Fix SQLite FD Exhaustion#493
pancacake merged 1 commit into
HKUDS:devfrom
thelooter:fix/fd-exhaustion

Conversation

@thelooter

Copy link
Copy Markdown
Contributor

Description

Currently the SQLite Implementation leaks file descriptors/connections. That means that when they get exhausted (by default thats after 1024 FDs), querying the DB fails. This fixes that.

Related Issues

  • Closes #...
  • Related to #...

Module(s) Affected

  • agents
  • api
  • config
  • core
  • knowledge
  • logging
  • services
  • tools
  • utils
  • web (Frontend)
  • docs (Documentation)
  • scripts
  • tests
  • Other: ...

Checklist

  • I have read and followed the contribution guidelines.
  • My code follows the project's coding standards.
  • I have run pre-commit run --all-files and fixed any issues.
  • I have added relevant tests for my changes.
  • I have updated the documentation (if necessary).
  • My changes do not introduce any new security vulnerabilities.

Additional Notes

Add any other context or screenshots about the pull request here.

@thelooter
thelooter changed the base branch from main to dev May 19, 2026 12:36
@pancacake
pancacake merged commit 79ea879 into HKUDS:dev May 29, 2026
@pancacake

Copy link
Copy Markdown
Collaborator

Thanks for your contribution!

pancacake added a commit that referenced this pull request Jun 11, 2026
#493 (sqlite): route _initialize() through the _connect() contextmanager
(the one remaining raw sqlite3.connect FD leak); document the auto-commit
contract so the redundant explicit commits are understood.

#529 (book):
- _strip_thinking_preamble: guard `{ not in text` before rindex() so plain
  prose (refusals/errors) no longer raises ValueError -> ERROR block;
  hoist json import to module top.
- llm_json: honor caller max_tokens as max(max_tokens, 2600) instead of
  discarding it; bump default to 2600; fix stale 'minimal' docstring -> 'low'.
- engine.compile_page: rebuild OVERVIEW pages deterministically via
  _materialize_overview_page on force, instead of running the generic LLM
  compiler over hand-built intro/concept-graph/index blocks.
- kb_health.scan_log_health: key repeated-failure detection on the op, not
  the free-text message, removing false positives/negatives + dead block_error.
- services/__init__: drop orphaned notebook_manager lazy-import + __all__ entry.
- PageReader.tsx: restore t() i18n on regenerate buttons; add 'Regenerating…'.
- remove PATCHES.md (developer-local scratch notes).

#484 (zulip): also match the disambiguated @**Name|user_id** mention form;
make the docstring truthful; add coverage.

#500: remove stray PR_DESCRIPTION.md committed to repo root.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
vaskoyudha added a commit to vaskoyudha/deeptutor-for-programmer-fork that referenced this pull request Jul 25, 2026
Wrap _connect() in a contextmanager that closes the connection after use,
preventing one leaked file descriptor per query.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
vaskoyudha added a commit to vaskoyudha/deeptutor-for-programmer-fork that referenced this pull request Jul 25, 2026
…#529/HKUDS#484

HKUDS#493 (sqlite): route _initialize() through the _connect() contextmanager
(the one remaining raw sqlite3.connect FD leak); document the auto-commit
contract so the redundant explicit commits are understood.

HKUDS#529 (book):
- _strip_thinking_preamble: guard `{ not in text` before rindex() so plain
  prose (refusals/errors) no longer raises ValueError -> ERROR block;
  hoist json import to module top.
- llm_json: honor caller max_tokens as max(max_tokens, 2600) instead of
  discarding it; bump default to 2600; fix stale 'minimal' docstring -> 'low'.
- engine.compile_page: rebuild OVERVIEW pages deterministically via
  _materialize_overview_page on force, instead of running the generic LLM
  compiler over hand-built intro/concept-graph/index blocks.
- kb_health.scan_log_health: key repeated-failure detection on the op, not
  the free-text message, removing false positives/negatives + dead block_error.
- services/__init__: drop orphaned notebook_manager lazy-import + __all__ entry.
- PageReader.tsx: restore t() i18n on regenerate buttons; add 'Regenerating…'.
- remove PATCHES.md (developer-local scratch notes).

HKUDS#484 (zulip): also match the disambiguated @**Name|user_id** mention form;
make the docstring truthful; add coverage.

HKUDS#500: remove stray PR_DESCRIPTION.md committed to repo root.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
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.

2 participants