Closed jamo closed 8 years ago
It seems like the error is coming from marshaling whatever is being cached. In a multi threaded setup the auto load behavior can cause a race condition where a class isn't loaded yet.
What is the value being cached? Can you use an explicit require? Alternately, can it be represented as JSON, in which case you can try using JSON serialization instead for that particular cache request.
Due to our need of Dir.chdir {}
, we are using the running multiprocess but singlethreaded passenger.
The content is basically this: https://tmc.mooc.fi/mooc/courses/35/points - a aggregated point list - which is mosty just hash of numbers with User AR objects. The converting it fully to json might actually be a nice optimization.
Basically all of the objects are models, so I would have expected for those to be required. But I'll try to require those explicitly.
Also, now that I changed the cron not to run the request in parallel I'm no longer seeing these exceptions.
Thanks, I'll manage, I just wanted to check if I ran into a race condition in this gem :)
Again, thanks for the report. If there is anything I can fix please leave an update.
Hey, I'm not fully sure if the exception I keep on getting is related to this gem; it started appearing recently, when I updated gems and migrated from dalli to redis cache and started using readthis.
And it appears for a kinda bad scenario, where there are four request coming for the cache with different id's at the same time... More below.
The setup:
Relevant config: code here
So it exception comes from the line below: Full code here
So, I've got four items
wget -qO- https://example.com/courses/:id/points &> /dev/null
in cron running every minute to keep the cache warm. Hacky, right :D. Anyways, all of these errors are for the last url in the cronjobs. So that's basically what leads me to believe that it could be either badly configured redis or maybe this gem / rails cache related issue. During last 24 hours, it seems, that I have gotten this exception seven times.