-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Models meta data cache fails to save and the app is DOWN!!! #13433
Comments
@Shay12tg We'll need a script to reproduce. As small as possible please. |
@sergeyklay thanks for the quick response.
|
Without DB:
This case should fail, but the case above should not. the app can continue without the cache or fallback to memory |
I think what you mean is "I need to write some code to check if the cache backend is up and if not fall back to a different cache method". |
To be honest in our production application we also have this problem with meta data memcache adapter, sometimes we even have some weird things written to metadata. It happens more often if we have enabled persistent connection. On other hand we use apc/apcu on fpm(don't ask me why) and it works perfectly fine. |
Relates to #13439 |
The However I have added an exception to the |
The relevant commit is here: |
Reopening this after discussion with @CameronHall If the metadata cache dies it should not kill the whole application.
$metadata->doNotRaiseExceptionOnWriteFailOtherwiseCameronWillThrowAFit(true); that will not throw an exception if the write fails but rather issue a warning in the logs for the devops team. |
@niden Consider using globals: Lines 35 to 112 in 9fae862
For more see: https://docs.zephir-lang.com/0.11/en/globals |
I agree, better use global. Also in some cases - metadata can't be saved because it can be actually too large - The maximum size of a value you can store in memcached is 1 megabyte there are cases that for some kind of huge model it can be bigger. |
Resolved #14112 |
If the model meta data cache fails to save, the app crashes... WTF?? :(
Over time it happens a lot and for me it's an issue... please help me find a solution for a stable app.
I use memcache to save metadata cache with the provided adapter ( Phalcon\Mvc\Model\Metadata\Memcache ).
I installed a simple local memcached instance.
it works.... until it went to production and it started failing.
So I added a memcached health check (connect and save random data) to the health check file. but no luck... still getting these errors about once a week and the app goes down for a few minutes/hours.
The app should not fail in this case (imo). it should catch the error, throw a warning and fallback to memory or something...
To recreate, use a memcached metadata adapter with no server.. it's about the same..
The app doesn't have to fail if the cache fails...
Error from cloudwatch:
Details
The text was updated successfully, but these errors were encountered: