-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
add Redis::OPT_READ_TIMEOUT option for issue #70 #260
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
Conversation
Note: You cannot |
Any word on this? It seems like a good feature to have while having no drawbacks.. |
@@ -915,9 +919,9 @@ PHPAPI int redis_sock_connect(RedisSock *redis_sock TSRMLS_DC) | |||
|
|||
php_stream_auto_cleanup(redis_sock->stream); | |||
|
|||
if(tv.tv_sec != 0) { | |||
if(read_tv.tv_sec != 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not just seconds? microseconds should be checked.
+1 on this pull request! |
+1 |
You should be able to set no timeout (overall). You also have to check the value of However, I think this is a reasonable feature to add (separate read timeout), so I'll get it in later tonight. |
Ok I see, but my understanding is setting |
Yes, I see your issue. I will get this merged tonight for you guys. :) Cheers! |
Hm I thought I posted this comment before, but can't see it anymore: Thank you very much for merging this quickly! |
You can go ahead and use master. I think it's a safe enough fix. Just let me know if there are any issues and I can fix them. |
I hate to nag, but is there any chance you could create a tag of the current version? |
Sure, seems fine to me. @nicolasff Any issue with me tagging the current master 2.2.3? I'm planning on tackling some of the session issues this week, so it could be a decent time. There have been many things incorporated since 2.2.2 |
I think it's a good idea, it's been a while a lots of features have made it to trunk since the last release. |
Pushed and tagged! :) Please let us know if anything was broken. There are quite a few features added in this release. Cheers! |
Thanks 😘, will report any problems |
This is a patch to fix issue #70 debug read error on connection.
Redis#connect()
uses its third argumenttimeout
not only for the connection timeout but also for the read timeout on an opened stream. (by callingphp_stream_set_option
on the stream)This behavior causes "read error" on any reading methods (get, hget, blpop, etc.) if you give very short timeout value to
connect()
.This patch adds
Redis::OPT_READ_TIMEOUT
forRedis#setOption()
so that you can specify another timeout value forphp_stream_set_option
.You can test this fix by @micharl-grunder's reproduce code.
Before
output:
After
output: