Stop a SQLite commit that waits for a lock once its transaction's context ends
维护者通常 1 天内回复
评估
调研方向
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 内容生成。
描述
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,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
gopherium/framework 的其他 Issue
-
bug help wanted
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
enhancement help wanted
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
enhancement help wanted
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
enhancement help wanted
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
enhancement help wanted
难度 3/5 1-2 天 新手友好度 65/100
维护者通常 1 天内回复
查看 gopherium/framework 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
eugenioenko/ttt#1206 ·
维护者通常 1 天内回复
-
t:urlDecodeUni does not map U+3002 and U+FF61 to a dot, unlike ModSecurity可能已有人在做 @fzipi 今天认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
peasant-labs/peasant#738 ·
维护者通常 1 天内回复
-
Duplicate review still bridges two books through a bundle whose first part has a colon subtitle可能已有人在做 @vavallee 今天认领。 未关闭area:library-scan bug priority:low
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复