-
Notifications
You must be signed in to change notification settings - Fork 66
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
SQLite Busy Exceptions not being treated as cache misses #241
Comments
I'm actually seeing it be wrapped as a I added the below code to a Rails initializer and it seems to solve the issue for us: module PatchSolidCacheFailSafe
private
def failsafe(method, returning: nil)
super
rescue ActiveRecord::StatementInvalid => e
raise e unless e.cause.is_a?(SQLite3::BusyException)
Rails.logger.warn("Caught SQLite3::BusyException in SolidCache::Store::FailSafe. Treating as cache miss.")
returning
end
end
SolidCache::Store::Failsafe.prepend(PatchSolidCacheFailSafe) Note: This is with Rails |
Dug a little further and it seems that it's because 7-2-stable does not wrap |
We finished upgrading to Rails However I'm of the opinion that this should still be fixed if Solid Cache wants to continue to support earlier versions of Rails with SQLite. |
We're experimenting with using SolidCache backed by SQLite in production and found that
SolidCache::Store::Failsafe
does not includeSQLite::Busy
exceptions as a possible transient error that would be treated is if it were a cache miss.Since this is something that could still theoretically occur with sharding and a reasonable busy timeout on SQLite configured, should this be added to the list of possible transient ActiveRecord errors?
The text was updated successfully, but these errors were encountered: