Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#104 コメント 1 件 リアクション 0 件 担当者 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分
マージ済み PR(30日)
38

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

gopherium/framework のほかの issue

gopherium/framework の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。