Skip to content

Commit 1608ef7

Browse files
committed
redis: allow for global (server-wide) locking
when system(!) environment variable OIDC_REDIS_MUTEX_GLOBAL is set, for backwards compatibility, through: PassEnv OIDC_REDIS_MUTEX_GLOBAL Signed-off-by: Hans Zandbelt <[email protected]>
1 parent 7faacc7 commit 1608ef7

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
09/13/2025
2+
- redis: apply global (server-wide) locking when system(!) environment variable
3+
OIDC_REDIS_MUTEX_GLOBAL is set, for backwards compatibility, through:
4+
PassEnv OIDC_REDIS_MUTEX_GLOBAL
5+
16
09/12/2025
27
- test: add util/*.c coverage tests
38

src/cache/redis.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,16 @@
4646
#include "cache/redis.h"
4747
#include "cfg/cfg_int.h"
4848

49-
// TODO: proper Redis error reporting (server unreachable etc.)
50-
5149
#define REDIS_CONNECT_TIMEOUT_DEFAULT 5
5250
#define REDIS_TIMEOUT_DEFAULT 5
5351
#define REDIS_KEEPALIVE_DEFAULT -1
5452

53+
#define OIDC_REDIS_MUTEX_GLOBAL_ENV_VAR "OIDC_REDIS_MUTEX_GLOBAL"
54+
5555
/* create the cache context */
5656
static oidc_cache_cfg_redis_t *oidc_cache_redis_cfg_create(apr_pool_t *pool) {
5757
oidc_cache_cfg_redis_t *context = apr_pcalloc(pool, sizeof(oidc_cache_cfg_redis_t));
58-
context->mutex = oidc_cache_mutex_create(pool, FALSE);
58+
context->mutex = oidc_cache_mutex_create(pool, getenv(OIDC_REDIS_MUTEX_GLOBAL_ENV_VAR) ? TRUE : FALSE);
5959
context->username = NULL;
6060
context->passwd = NULL;
6161
context->database = -1;

0 commit comments

Comments
 (0)