Skip to content
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

"save" produce PHP Notice if there is not free memory in Redis #150

Open
kandy opened this issue Jan 22, 2020 · 5 comments
Open

"save" produce PHP Notice if there is not free memory in Redis #150

kandy opened this issue Jan 22, 2020 · 5 comments

Comments

@kandy
Copy link

kandy commented Jan 22, 2020

Steps:

  • I configure limited size of redis (40MB)
  • Redis php extension is not installed
  • I create a script and run
<?php
       $cache = new Cm_Cache_Backend_Redis([ ... ]);
       while (true) {
           $cache->save('data', "my_test_data" . $i++, ['tag1', 'tag2', 'tag3_'.$i ]);
       }

WIG:
PHP Notice: Undefined offset: 5 in /app/vendor/colinmollenhour/credis/Client.php on line 963
WIE:
save will return false or exception

@colinmollenhour
Copy link
Owner

On master line 963 is a comment.. Are you using the latest version?

https://github.com/colinmollenhour/credis/blob/master/Client.php#L963

@kandy
Copy link
Author

kandy commented Jan 23, 2020

I test on version 1.10.6 of colinmollenhour/cache-backend-redis package
On master, it will be https://github.com/colinmollenhour/credis/blob/master/Client.php#L991 line

@colinmollenhour
Copy link
Owner

Thanks. The answer is not obvious to me so this would require further investigation which I don't know when I'd be able to do. I'd be happy to review a PR if you can find the issue, or if you can at least provide a screenshot of a debugger at this step I might be able to help more.

@Xon
Copy link
Contributor

Xon commented Jan 24, 2020

What version of Redis?

@kandy
Copy link
Author

kandy commented Jan 24, 2020

@Xon
redis_version:5.0.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants