Ractor support
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start with lib/sqlite3/database.rb:89 and run the Ractor reproduction in the issue under Ruby 3. Trace the C-extension path involved in opening the database and determine what Ractor support requires. Done means the example can construct and use the database from a non-main Ractor without Ractor::UnsafeError.
Written by the indexing model from the issue text.
Description
Hello maintainers,
Is there any interest or planned change to add support to this gem for use within a Ruby 3 Ractor?
Currently, constructing a database instance is failing with the error message introduced into this Ruby commit. I have collected this stacktrace:
~/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/sqlite3-1.4.2/lib/sqlite3/database.rb:89:in `open_v2': ractor unsafe method called from not main ractor (Ractor::UnsafeError)
from ~/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/gems/sqlite3-1.4.2/lib/sqlite3/database.rb:89:in `initialize'
...
It can be reproduced by:
sqlite_ractor = Ractor.new do
db = SQLite3::Database.open "xyz.db"
end
puts sqlite_ractor.take
The Ruby commit message justifies the error because:
C extensions can violate the ractor-safety
However, this gem doesn't appear to store references to Ruby objects that might be accessed across Ractors / invalidly shared, so perhaps its C extensions can be marked as Ractor-safe?
- Dominant language
- Ruby
- Stars
- 845
- Forks
- 220
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 4
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing 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.
More from sparklemotion/sqlite3-ruby
-
needs-more-info
Difficulty 3/5 1-2 days Newbie friendliness 42/100
sparklemotion/sqlite3-ruby#653 · 3 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
sparklemotion/sqlite3-ruby#639 · 4 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
sparklemotion/sqlite3-ruby#628 · 10 comments · 1 reaction ·
-
bug help-wanted platform/windows
Difficulty 4/5 3-5 days Newbie friendliness 35/100
sparklemotion/sqlite3-ruby#618 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
sparklemotion/sqlite3-ruby#573 · 2 comments ·
All issues in sparklemotion/sqlite3-ruby
Similar issues
-
security
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
CircuitVerse/CircuitVerse#7967 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
simp/pupmod-simp-stunnel#173 ·
-
Polish QDrantOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
o19s/quepid#1825 · 1 comment ·
Maintainers usually reply within 1 day