You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're experimenting with using SolidCache backed by SQLite in production and found that SolidCache::Store::Failsafe does not include SQLite::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:
I'm actually seeing it be wrapped as a ActiveRecord::StatementInvalid when it happens.
I added the below code to a Rails initializer and it seems to solve the issue for us:
modulePatchSolidCacheFailSafeprivatedeffailsafe(method,returning: nil)superrescueActiveRecord::StatementInvalid=>eraiseeunlesse.cause.is_a?(SQLite3::BusyException)Rails.logger.warn("Caught SQLite3::BusyException in SolidCache::Store::FailSafe. Treating as cache miss.")returningendendSolidCache::Store::Failsafe.prepend(PatchSolidCacheFailSafe)
Dug a little further and it seems that it's because 7-2-stable does not wrap SQLite3::BusyException as an ActiveRecord::StatementTimeout so the catch all in the abstract adapter will convert it to a StatementInvalid
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: