Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Stop a SQLite commit that waits for a lock once its transaction's context ends

未关闭
#104 1 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@SirLouen 已经在做这个了。

开始于 2026年10月22日。

  • #105 来自 @bfs2021 —— 已关闭,未合并
  • #106 来自 @Erfouni —— 已关闭,未合并

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
go, sqlite
领域
backend, database

调研方向

Start with busyConn.BeginTx and dbkit/sqlite/busy_test.go, especially busyAttachHeld. First verify whether the driver rollback after a failed commit can wait for a lock, then write a red test using an attached rollback journal file held by a reader. Done when a commit waiting on that lock stops when the transaction context ends, while rollback remains safe for the connection pool.

由索引模型根据 Issue 内容生成。

描述

bug

A commit that waits for a lock on SQLite should stop once the context of its transaction ends, as every other call already does.

Current state: from dbkit/sqlite v0.2.0, every call that takes a context hands it to dbkit's busy handler, so its wait for a lock stops once the context ends. Tx.Commit takes no context, and BeginTx returns the driver's transaction as it is, so a commit that waits runs with no context and waits up to BusyTimeout. dbkit's own file never waits at commit, because its write transactions take the write lock at BEGIN IMMEDIATE. A commit waits only when the transaction wrote to an attached rollback journal database while another connection reads it. Measured: the context ended at 100ms and Commit answered 1.46s later, once the reader let go.

Proposal: wrap the driver's transaction in busyConn.BeginTx so that Commit runs under the context BeginTx was given. Leave Rollback unwrapped: database/sql rolls back on an ended context, and a rollback that stopped early would put a connection still inside a transaction back in the pool. Prove first that the rollback the driver runs after a failed commit never waits for a lock. Test it red first with an attached rollback journal file held by a reader, as busyAttachHeld in dbkit/sqlite/busy_test.go does.

Trigger: dbkit/sqlite v0.2.0 is released.

主要语言
Go
星标
69
派生
3
平均合并
9 小时 11 分钟
30 天内合并 PR
38

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

gopherium/framework 的其他 Issue

查看 gopherium/framework 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。