Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fork safety warning when booting Solid Queue #506

Open
alxckn opened this issue Jan 31, 2025 · 2 comments
Open

Fork safety warning when booting Solid Queue #506

alxckn opened this issue Jan 31, 2025 · 2 comments

Comments

@alxckn
Copy link

alxckn commented Jan 31, 2025

In the context of a brand new app with Solid Queue installed (SQlite), a warning is emitted when booting the supervisor using bin/jobs start:

.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/sqlite3-2.5.0-x86_64-linux-gnu/lib/sqlite3/fork_safety.rb:43: warning: Writable sqlite database connection(s) were inherited from a forked process. This is unsafe and the connectio
ns are being closed to prevent possible data corruption. Please close writable sqlite database connections before forking.

There seems to be at least three places where a connection is established and not closed before the supervisor forks workers, dispatchers or schedulers:

I'd expect this will be hard to abstain from issuing connections in the supervisor process, so perhaps connections should be explicitely closed by Solid Queue before forking processes.

@flavorjones
Copy link
Member

In Rails 8, rails/rails@7c34062b contains this line to suppress this warning.

What version of Rails are you seeing this with?

@alxckn
Copy link
Author

alxckn commented Feb 18, 2025

@flavorjones indeed sorry this issue should have specified the versions!

The warning is not there with rails 8.0.1, I must have initially gotten it with rails 7.2. It will be shown when sqlite3 > 2.1.0 and rails < 8.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants