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
Segmentation fault when execution time of LUA script exceeds timeout #437
Comments
Hey, Interesting. I will attempt to replicate this. Cheers, |
function if we get a protocol error, rather than just throwing and exception and breaking execution of the loop. Addresses #437
Hey, Please try this hotfix on the branch Cheers and thanks for the report! |
Thanks for quick response! Segmantation fault error has disappeared :) Now it throws this exception:
Which is quite ok, but more accurate exception would be great (saying that it is timeout related error) |
Yeah, that's just the error message that means, essentially, a timeout. I'll get this merged into master this evening. Cheers,
|
Hi, I am experiencing a similar situation, a LUA script that original gave a segmentation fault, we updated php redis, and now I get the same two exceptions as above, 'Socket error on read' followed by 'protocal error' with a non-standard character. you said :
could you elaborate? My LUA was running fine a month ago, and appears to still run, though I am having an issue with the client returning these two exceptions thanks |
Hey, Sure. I meant that it was obvious what the bug was inside of the phpredis C code. Essentially, I was throwing an exception and not returning from the function, but rather just breaking out of a switch. This meant phpredis tried to access a NULL pointer which is a bad thing. :) The first error seems good to me (it is in fact timing out), but the second one seems problematic. It shouldn't throw a protocol error exception after that. Are you using connect or pconnect, and is your lua script by chance inside of a multi block? Cheers, |
Hi, I am using connect, not pconnect. I am not using a multi block. My LUA script is very similar to the other person's above. I take the LUA and load it, then call it via the evalsha method. |
Cool. I will try to replicate the protocol error locally. Hopefully it's easy enough to track down. As a quick workaround you can try bumping your timeout so the script doesn't fail in that way. |
which timeout? do you mean when I connect? or do you mean the lua-time-limit? |
I'm speaking of your connect timeout, and also you should set this option in phpredis:
I'll also see what phpredis does if the script simply times out server side, but I believe that should work fine (would probably just return false). |
I wanted to send this privately, can add on github if you want. I did that set option, and it appears to now throw 0 exceptions. [my connection time out, in method connect() was set to 0, which I thought meant unlimited ] Do you think using set option is the Fix, or a temporary solution ? Again, thanks for your help on this. From: Michael Grunder [mailto:notifications@github.com] I'm speaking of your connect timeout, and also you should set this option in phpredis: $obj_redis->setOption(Redis::OPT_READ_TIMEOUT, ); I'll also see what phpredis does if the script simply times out server side, but I believe that should work fine (would probably just return false). — |
Hey, I've never got a problem with communicating over GitHub as that makes it It can be a bit confusing, but phpredis uses two separate timeout values. I need to investigate what is causing the protocol error (as that part Cheers! On Tue, Apr 22, 2014 at 10:00 AM, dwguesswho notifications@github.comwrote:
|
I just tested 5x and everything went smoothly. I no longer get either exception. again, thanks ! |
Nice one. I'll leave this open while I track down the cause of that second exception you're seeing. |
Hi, I'm getting segmentation fault error when execution time of lua script exceeds timeout defined in Redis::connect(), here is example code:
and here is gdb output:
The text was updated successfully, but these errors were encountered: