Miloslav Hůla
Miloslav Hůla
My point is that offline state is a normal cache state, not a fault. Cache is not permanent data storage. With your patch... what happend when server is online when...
I checked that "offline message" notice is catched by callback.
Yes, NULL or FALSE is returned without notice, but only when server is offline during `addServer()`. If gets offline between `addServer()` and `read()/write()`, Notice is still thrown.
I have done small investigation... One big advantage of Memcache class is, that can be used with offline servers. Actually it works without added servers. Yes, it emits notices/warnings but...
Accordingly to provided message: ``` "\x00\x00\x00\x00 ... a:2:{s:2:"id";b:1;s:4:"code";b:1;}" ``` I thing that cache writing fails [here](https://github.com/nette/caching/blob/06e95baec66c9b2b26cecdd7031e0f24373f99ee/src/Caching/Storages/FileStorage.php#L212). Not sure why, but the malformed file should be deleted anyway by [delete()](https://github.com/nette/caching/blob/06e95baec66c9b2b26cecdd7031e0f24373f99ee/src/Caching/Storages/FileStorage.php#L355) call...
The code itself looks atomic to me. My idea is, that malformed cache contents cames with script interruption. Any other theory? When thinking about it in common, the only safe...
@Lumeriol Do you have any notice/warning/error with `FileStorage.php` source in log before this event?
> > that malformed cache contents cames with script interruption > > Yes, that's what usually called non-atomic. Atomic write requires writing to another file and renaming it after. IMHO...
What I don't understand... How is unserialize() called when there is a [check](https://github.com/nette/caching/blob/06e95baec66c9b2b26cecdd7031e0f24373f99ee/src/Caching/Storages/FileStorage.php#L306). @Lumeriol Do you have Tracy log for that? Could you post is somewhere whole?
Maybe related to PHP bug [77081](https://bugs.php.net/bug.php?id=77081) fixed in 7.3RC5