crystal-sqlite3
crystal-sqlite3 copied to clipboard
Connection are not promptly closed when transactions are used, eventually leading to file descriptor exaustion.
For easy reproduction, just run this and wait a bit:
require "sqlite3"
puts "PID is #{Process.pid}"
DB.open("sqlite3://./test-db-feel-free-to-delete-me.sqlite") do |db|
db.exec("CREATE TABLE IF NOT EXISTS foo (bar)")
loop do
db.transaction do
db.exec("INSERT INTO foo VALUES (1)")
end
end
end
The PID output is so that you can browse to /proc/$PID/fd
and see the number of open file descriptors accumulate.
Hi, Maybe this issue have been changed on latest version, please ask on Gitter or #crystal-lang about this.