Repository navigation
fix: 修复 Docker SQLite WAL 初始化失败 - #43
Closed
xunxun1982 wants to merge 5 commits into
Closed
xunxun1982 wants to merge 5 commits into
xunxun1982 wants to merge 5 commits into
Conversation
修复 Docker bind mount 等场景下 SQLite 切换 WAL 报 disk I/O error 后继续复用异常连接的问题。 WAL 初始化失败时关闭当前连接,重新连接并回退到 DELETE journal mode,同时缓存回退状态,避免后续反复重试 WAL。 补充 issue jiujiu532#31 的初始化回归测试,并同步修正现有测试断言,匹配默认禁用 VACUUM 与批量刷新摘要字段。 关联:jiujiu532#31
- 针对 jiujiu532#31 中 Docker 环境下 accounts.db 仍为 0 字节的问题,补充 SQLite 初始化阶段的 WAL 写入失败降级逻辑 - 当 WAL 设置表面成功但首次建表写入抛出 disk I/O error 时,自动禁用 WAL 并使用 DELETE journal 重新执行一次幂等初始化 - 保留正常 WAL 路径性能;非 disk I/O error 或降级后仍失败的场景继续抛出原始异常,避免掩盖真实故障 - 新增回归测试覆盖 WAL 首次写入失败后的初始化恢复,并断言降级后不会重复尝试 WAL
在本地 SQLite schema 初始化阶段加入有限降级重试: 当 Docker bind mount 等环境中 WAL 或 DELETE journal 写入仍触发 disk I/O error 时, 继续切换到 MEMORY journal 执行幂等建表,避免 accounts.db 停留为 0 字节导致启动失败。
将账号列表排序索引 idx_acc_live_updated 从核心 schema 初始化中拆出, 先提交必要账号表、基础索引和兼容列,再单独创建该性能索引。 当 Docker bind mount 等环境在创建该索引时触发 disk I/O error, 允许服务继续启动并退回无该索引的慢查询路径。 补充回归测试覆盖可选索引创建失败时账号表仍初始化成功, 同时保留正常环境下账号列表查询命中性能索引的验证。
在本地 SQLite 初始化连续遇到 WAL、DELETE、MEMORY journal 写入 disk I/O error 时, 最后一次仅对建库连接使用 nolock=1 URI 兜底,避免 Docker bind mount 环境空库启动失败。 no-lock 只作用于幂等 schema 初始化,初始化成功后的账号读写仍使用普通 SQLite 连接和文件锁, 避免绕过锁影响运行期并发安全。 补充回归测试,覆盖 MEMORY journal 仍写入失败后使用 no-lock 完成初始化, 并验证后续读取恢复普通连接。
hackjown
pushed a commit
to hackjown/grok2api
that referenced
this pull request
Jul 13, 2026
…to-grok-superimage-1.0-hr1q8r feat: expose grok-superimage-1.0 via /v1/chat/completions and fix image streaming
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.
修复 Docker bind mount 等场景下 SQLite 切换 WAL 报 disk I/O error 后继续复用异常连接的问题。 WAL 初始化失败时关闭当前连接,重新连接并回退到 DELETE journal mode,同时缓存回退状态,避免后续反复重试 WAL。 补充 issue #31 的初始化回归测试,并同步修正现有测试断言,匹配默认禁用 VACUUM 与批量刷新摘要字段。
关联:#31
Summary
Testing
Related