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
+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