In my Sidekiq jobs, I get a lot of these failures:
Errno::ENOENT: No such file or directory @ rb_file_s_rename - (/usr/src/app/tmp/cache/.rails-settings-cached2Fv120241107-214-skp40x, /usr/src/app/tmp/cache/983/850/rails-settings-cached%2Fv1)
I assume this is because of multiple workers accessing the file at once, renaming it, etc. I'm clearing the cache before each job to make sure the jobs don't use stale settings from the main app, which is think might be causing a race condition where one worker has cleared the cache being used by another one.
before_perform do |job|
SiteSettings.clear_cache
end
Is there a way to make the workers use separate cache files? They shouldn't really be removing something used by a different one.
Unfortunately I don't get a useful backtrace to identify exactly where it's happening. Has anyone seen this and solved it, or am I doing something unique and weird?
Disable cache for sidekiq workers (not sure if this is possible)
Use a different cache store for sidekiq workers, like a pure memory store so there's no disk race condition; each process would inherently get its own cache then as well.
In my Sidekiq jobs, I get a lot of these failures:
I assume this is because of multiple workers accessing the file at once, renaming it, etc. I'm clearing the cache before each job to make sure the jobs don't use stale settings from the main app, which is think might be causing a race condition where one worker has cleared the cache being used by another one.
Is there a way to make the workers use separate cache files? They shouldn't really be removing something used by a different one.
Unfortunately I don't get a useful backtrace to identify exactly where it's happening. Has anyone seen this and solved it, or am I doing something unique and weird?