Skip to content

⚡ Bolt: [성능 개선] SQLite WAL PRAGMA 중복 실행 제거 - #409

Closed
seonghobae wants to merge 2 commits into
mainfrom
bolt-sqlite-wal-pragma-optimize-13551279858679692671
Closed

⚡ Bolt: [성능 개선] SQLite WAL PRAGMA 중복 실행 제거#409
seonghobae wants to merge 2 commits into
mainfrom
bolt-sqlite-wal-pragma-optimize-13551279858679692671

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 12, 2026

Copy link
Copy Markdown
Contributor
  • 💡 What: job_store.pyusage_metering.py에서 매 데이터베이스 연결마다 실행하던 PRAGMA journal_mode=WAL을 초기화 시 한 번만 실행하도록 변경
  • 🎯 Why: SQLite의 WAL 모드는 데이터베이스 파일별로 영구적이므로 수명이 짧은 연결마다 매번 PRAGMA를 실행할 필요가 없으며, 이를 제거하여 매번 발생하는 I/O 및 처리 오버헤드를 줄임
  • 📊 Impact: 불필요한 시스템 호출 및 중복 쿼리 제거
  • 🔬 Measurement: test_job_store.pytest_usage_metering.py 등 기존 테스트의 정상 통과 확인

PR created automatically by Jules for task 13551279858679692671 started by @seonghobae

Summary by CodeRabbit

  • 성능 개선

    • 데이터베이스 초기화 시 SQLite WAL 모드를 한 번만 설정하도록 개선했습니다.
    • 이후 연결마다 반복되던 설정 작업을 줄여 작업 및 사용량 기록 처리의 성능을 향상했습니다.
  • 문서

    • 이번 데이터베이스 처리 개선 사항을 변경 로그와 개발 안내 문서에 반영했습니다.

`job_store.py` 및 `usage_metering.py`에서 매 데이터베이스 연결마다 실행하던 `PRAGMA journal_mode=WAL`을 초기화 시 한 번만 실행하도록 변경하여 매번 발생하는 I/O 및 쿼리 오버헤드를 줄였습니다. SQLite의 WAL 모드는 데이터베이스 파일 단위로 한 번 설정하면 영구적으로 유지되므로 매 연결 시마다 재설정할 필요가 없습니다.
@google-labs-jules

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

SQLite WAL 설정을 개별 연결마다 실행하던 동작을 제거했습니다. JobStoreusage_metering의 데이터베이스 초기화 단계에서 WAL 설정과 스키마 생성을 수행하도록 변경했습니다. 관련 학습 항목과 변경 이력을 추가했습니다.

Changes

SQLite WAL 초기화

Layer / File(s) Summary
초기화 및 연결 동작 변경
job_store.py, usage_metering.py, .jules/bolt.md, CHANGELOG.md
두 저장소가 데이터베이스 초기화 시 WAL 모드를 설정합니다. 이후 연결에서는 WAL 설정을 반복하지 않습니다. 관련 문서와 변경 이력을 갱신했습니다.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 SQLite WAL PRAGMA 중복 실행 제거라는 주요 변경 사항을 명확하고 간결하게 설명합니다.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bolt-sqlite-wal-pragma-optimize-13551279858679692671

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
job_store.py (1)

110-111: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

_connect() docstring의 책임 설명을 갱신하세요.

WAL 설정은 초기화 단계로 이동했으므로 _connect()가 WAL을 활성화한다고 설명하면 안 됩니다.

  • job_store.py#L110-L111: 연결 생성 및 현재 journal mode 상속을 설명하도록 docstring을 수정하세요.
  • usage_metering.py#L131-L132: 동일한 내용으로 docstring을 수정하세요.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@job_store.py` around lines 110 - 111, Update the _connect() docstrings in
job_store.py lines 110-111 and usage_metering.py lines 131-132 to describe
creating a connection and inheriting the current journal mode; remove any claim
that _connect() enables WAL.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@job_store.py`:
- Around line 110-111: Update the _connect() docstrings in job_store.py lines
110-111 and usage_metering.py lines 131-132 to describe creating a connection
and inheriting the current journal mode; remove any claim that _connect()
enables WAL.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 16d2ab42-55cb-4905-9844-6c77bceaec8f

📥 Commits

Reviewing files that changed from the base of the PR and between a8e4956 and 29e1e69.

📒 Files selected for processing (4)
  • .jules/bolt.md
  • CHANGELOG.md
  • job_store.py
  • usage_metering.py

`job_store.py` 및 `usage_metering.py`에서 매 데이터베이스 연결마다 실행하던 `PRAGMA journal_mode=WAL`을 초기화 시 한 번만 실행하도록 변경하여 매번 발생하는 I/O 및 쿼리 오버헤드를 줄였습니다. SQLite의 WAL 모드는 데이터베이스 파일 단위로 한 번 설정하면 영구적으로 유지되므로 매 연결 시마다 재설정할 필요가 없습니다.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head 8c139e3e3ba77fd80b3a333c09285520685fda32.

  • Head SHA: 8c139e3e3ba77fd80b3a333c09285520685fda32

  • Workflow run: 31657118986

  • Workflow attempt: 1

Coverage evidence

Coverage evidence job did not run or did not publish coverage evidence.

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file (4 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (4 files)"]
  R1 --> V1["required checks"]
Loading

@opencode-agent

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

  • Head SHA: 8c139e3e3ba77fd80b3a333c09285520685fda32
  • Workflow run: 31657118986
  • Workflow attempt: 1
  • Gate result: REQUEST_CHANGES (approval step)

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head 8c139e3e3ba77fd80b3a333c09285520685fda32.

  • Head SHA: 8c139e3e3ba77fd80b3a333c09285520685fda32

  • Workflow run: 31657118986

  • Workflow attempt: 1

Coverage evidence

Coverage evidence job did not run or did not publish coverage evidence.

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file (4 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (4 files)"]
  R1 --> V1["required checks"]
Loading

Copy link
Copy Markdown
Contributor Author

Closing as superseded by #380 after exact-diff review. #380 preserves this WAL-once optimization for both job and usage stores on the live-base branch, corrects the connection docstrings, verifies SQLite actually returned wal before creating schema, and adds fail-closed regressions for missing/non-WAL results. This branch has no remaining unique production behavior.

@seonghobae seonghobae closed this Aug 14, 2026
@google-labs-jules

Copy link
Copy Markdown

Closing as superseded by #380 after exact-diff review. #380 preserves this WAL-once optimization for both job and usage stores on the live-base branch, corrects the connection docstrings, verifies SQLite actually returned wal before creating schema, and adds fail-closed regressions for missing/non-WAL results. This branch has no remaining unique production behavior.

Understood. Acknowledging that this work is now obsolete and stopping work on this task.

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