sparklemotion / sparklemotion/sqlite3-ruby

exec_batch does not release GVL.

Open
#287 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
845
Forks
220
Avg merge
2d 17h
Merged PRs (30d)
3

Description

#!/usr/bin/env ruby

require 'sqlite3'

Thread.new do
	while true
		sleep 0.1
		$stdout.write '.'
	end
end

s = "SELECT 1;"*500000
db = SQLite3::Database.new(':memory:')

sleep 1

$stdout.write '>'
db.execute_batch2(s)
$stdout.write '<'

sleep 1

Gives

koyoko% ./sqlite3.rb
..........>.<..........

Expected:

koyoko% ./sqlite3.rb
..........>............<..........

Or something to that effect.

cc @ko1 @tenderlove @jeremyevans

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the provided Ruby reproduction and the execute_batch2 entry point, then trace how the batch operation interacts with Ruby threads and the GVL. Done means the background thread continues producing output while execute_batch2 runs, with coverage for this behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby, sqlite
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.