Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8dada17

Browse files
arokettumichael-grunder
authored andcommitted
Add an INI setting returning 5.x legacy behavior -- readonly session on lock failure
1 parent152fdda commit8dada17

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

‎redis.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ PHP_INI_BEGIN()
114114
PHP_INI_ENTRY("redis.session.lock_expire","0",PHP_INI_ALL,NULL)
115115
PHP_INI_ENTRY("redis.session.lock_retries","100",PHP_INI_ALL,NULL)
116116
PHP_INI_ENTRY("redis.session.lock_wait_time","20000",PHP_INI_ALL,NULL)
117+
PHP_INI_ENTRY("redis.session.lock_failure_readonly","0",PHP_INI_ALL,NULL)
117118
PHP_INI_ENTRY("redis.session.early_refresh","0",PHP_INI_ALL,NULL)
118119
PHP_INI_ENTRY("redis.session.compression","none",PHP_INI_ALL,NULL)
119120
PHP_INI_ENTRY("redis.session.compression_level","3",PHP_INI_ALL,NULL)

‎redis_session.c‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -777,9 +777,14 @@ PS_READ_FUNC(redis)
777777
}
778778

779779
if (lock_acquire(redis_sock,&pool->lock_status)!=SUCCESS) {
780-
php_error_docref(NULL,E_WARNING,"Failed to acquire session lock");
781-
efree(cmd);
782-
returnFAILURE;
780+
if (INI_INT("redis.session.lock_failure_readonly")) {
781+
// opt-in legacy behavior: readonly session
782+
php_error_docref(NULL,E_WARNING,"Failed to acquire session lock, session will be read only");
783+
}else {
784+
php_error_docref(NULL,E_WARNING,"Failed to acquire session lock");
785+
efree(cmd);
786+
returnFAILURE;
787+
}
783788
}
784789

785790
if (redis_sock_write(redis_sock,cmd,cmd_len)<0) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp