Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpredis/phpredis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormichael-grunder <michael.grunder@gmail.com>2020-04-17 17:27:26 +0300
committermichael-grunder <michael.grunder@gmail.com>2020-04-17 17:27:26 +0300
commitb1d00fd5262c308643c69a11655eca62cf967bc4 (patch)
treed6b270d80071e83c1894bb44c1bd43e3c2521bc9
parent571dd962053a11f79c6827e24be5eeeabb17912e (diff)
Add an inexpensive liveness check and make challenge/response optional5.2.1-livenessrelease/5.2.1-liveness-patch
See #1742 and countless other persistent connection issues.
-rw-r--r--library.c2
-rw-r--r--redis.c1
2 files changed, 3 insertions, 0 deletions
diff --git a/library.c b/library.c
index 65f37820..815523f7 100644
--- a/library.c
+++ b/library.c
@@ -1810,6 +1810,8 @@ redis_sock_check_liveness(RedisSock *redis_sock)
/* Check socket liveness using 0 second timeout */
if (php_stream_set_option(redis_sock->stream, PHP_STREAM_OPTION_CHECK_LIVENESS, 0, NULL) != PHP_STREAM_OPTION_RETURN_OK) {
return FAILURE;
+ } else if (!INI_INT("redis.pconnect.echo_check_liveness")) {
+ return SUCCESS;
}
if (redis_sock->auth) {
diff --git a/redis.c b/redis.c
index 1a19c6a5..131e7c4f 100644
--- a/redis.c
+++ b/redis.c
@@ -90,6 +90,7 @@ PHP_INI_BEGIN()
/* redis pconnect */
PHP_INI_ENTRY("redis.pconnect.pooling_enabled", "1", PHP_INI_ALL, NULL)
PHP_INI_ENTRY("redis.pconnect.connection_limit", "0", PHP_INI_ALL, NULL)
+ PHP_INI_ENTRY("redis.pconnect.echo_check_liveness", "1", PHP_INI_ALL, NULL)
/* redis session */
PHP_INI_ENTRY("redis.session.locking_enabled", "0", PHP_INI_ALL, NULL)