sparklemotion / sparklemotion/sqlite3-ruby
exec_batch does not release GVL.
Open
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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