laruence / yac

A fast, lock-free, shared memory user data cache for PHP
Other
824 stars 198 forks source link

Warning: Yac::get(): Unserialization failed #57

Closed captainQW closed 8 years ago

captainQW commented 8 years ago

这个错误是由什么引起的?

laruence commented 8 years ago

一般是因为数据写花了导致的, 应该把这个警告给禁掉. 回头处理下.

captainQW commented 8 years ago

Warning: Yac::get(): Decompression failed

还有这种解压失败的。。。

laruence commented 8 years ago

忽略即可, 以后可以考虑去掉这些警告

gouchaoer commented 8 years ago

其实这种极小概率的出错warning并没问题,自己处理可以设置handler把warning抛出成异常再处理

itbdw commented 5 years ago

Hey, actually, this is expected behaviors, yac is a lockless cache, that is why it is so fast and also has some issues like this.but this(the warnings you saw) also is a protection for preventing wrong data goes to user script.to reduce this warnings: you need try to avoid or reduce the probability of multiple processes seting one key. increase the slots size, or you can increase the crc bytes(I will add a configuration in php.ini for this later).thanks

https://github.com/laruence/yac/issues/23#issuecomment-22808078