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
There is a bug in all cache backends that use their internal functions (for example apc_inc). The value that is incremented or decremented must be stored as int, but all frontends use serialization. If you serialize value it becomes some sort of string and then inc/dec fails.
$cache->save('myval',1);
// value is stored as: "i:1;"// phalcon/cache/frontend/data.zep#L132: // public function beforeStore(var data) { return serialize(data); }$result = $cache->increment('myval');
// apc_inc("i:1;")// returns false
The solution would be to check if frontend uses serialization then don't use internal functions (you loose atomic operation) and risk race conditions and value incorrectly incremented in two separate threads.
Or allow normal expiration time in phalcon/cache/frontend/none.zep so you can use it as frontend without serialization.
The text was updated successfully, but these errors were encountered:
There is a bug in all cache backends that use their internal functions (for example apc_inc). The value that is incremented or decremented must be stored as int, but all frontends use serialization. If you serialize value it becomes some sort of string and then inc/dec fails.
The solution would be to check if frontend uses serialization then don't use internal functions (you loose atomic operation) and risk race conditions and value incorrectly incremented in two separate threads.
Or allow normal expiration time in phalcon/cache/frontend/none.zep so you can use it as frontend without serialization.
The text was updated successfully, but these errors were encountered: