mirror of
https://github.com/phpredis/phpredis.git
synced 2026-06-19 07:35:31 +00:00
Add an INI setting returning 5.x legacy behavior -- readonly session on lock failure
This commit is contained in:
committed by
Michael Grunder
parent
152fdda9b1
commit
8dada174c4
@@ -114,6 +114,7 @@ PHP_INI_BEGIN()
|
||||
PHP_INI_ENTRY("redis.session.lock_expire", "0", PHP_INI_ALL, NULL)
|
||||
PHP_INI_ENTRY("redis.session.lock_retries", "100", PHP_INI_ALL, NULL)
|
||||
PHP_INI_ENTRY("redis.session.lock_wait_time", "20000", PHP_INI_ALL, NULL)
|
||||
PHP_INI_ENTRY("redis.session.lock_failure_readonly", "0", PHP_INI_ALL, NULL)
|
||||
PHP_INI_ENTRY("redis.session.early_refresh", "0", PHP_INI_ALL, NULL)
|
||||
PHP_INI_ENTRY("redis.session.compression", "none", PHP_INI_ALL, NULL)
|
||||
PHP_INI_ENTRY("redis.session.compression_level", "3", PHP_INI_ALL, NULL)
|
||||
|
||||
+8
-3
@@ -777,9 +777,14 @@ PS_READ_FUNC(redis)
|
||||
}
|
||||
|
||||
if (lock_acquire(redis_sock, &pool->lock_status) != SUCCESS) {
|
||||
php_error_docref(NULL, E_WARNING, "Failed to acquire session lock");
|
||||
efree(cmd);
|
||||
return FAILURE;
|
||||
if (INI_INT("redis.session.lock_failure_readonly")) {
|
||||
// opt-in legacy behavior: readonly session
|
||||
php_error_docref(NULL, E_WARNING, "Failed to acquire session lock, session will be read only");
|
||||
} else {
|
||||
php_error_docref(NULL, E_WARNING, "Failed to acquire session lock");
|
||||
efree(cmd);
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
if (redis_sock_write(redis_sock, cmd, cmd_len) < 0) {
|
||||
|
||||
Reference in New Issue
Block a user