Purple-Devs / health_check

Simple health check of Rails app for use with uptime checking sites like newrelic and pingdom
MIT License
476 stars 125 forks source link

health_check failed: No such file or directory @ dir_s_mkdir - /app/tmp/cache/AC2/CA0. #130

Open trombini77 opened 1 year ago

trombini77 commented 1 year ago

Today I´m using this lib with following setup:

Ruby: 3.2.0 Rails: 7.0.4.2

health_check.rb:

config.standard_checks = ["site", "cache", "database", "rabbitmq", "redis", "sidekiq-redis"]

the health check endpoint is hit several times from Kubernetes readiness and liveness probes, load balance health checks and external SaaS of monitoring.

And belong a period of one minute, for example, always appears few errors like this:

health_check failed: No such file or directory @ dir_s_mkdir - /app/tmp/cache/AC2/CA0.
Completed 500 Internal Server Error in 2ms (Views: 0.2ms | ActiveRecord: 0.0ms | MongoDB: 0.0ms | Allocations: 407)

Feels like a concurrent hit is trying to use the same cache object and conflict (while one hit is clean the cache object, another concurrent hit is trying to use the object that is being erased in the cache)

I can´t clean this kind of error and is not an error of directory permission.

Did somebody have an issue close to these before?!?!

jmarchello commented 1 year ago

I remember seeing a few cases in the codebase where concurrency support/thread safety needs to be taken into account. So I'm inclined to agree with your prognosis.