From 9b057aafb0c41bab63870277c53307d3d6dc572b Mon Sep 17 00:00:00 2001 From: Michael Griego Date: Wed, 24 Mar 2021 17:03:48 -0500 Subject: [PATCH] Enable session locking for the redis session handler and use more sane locking configs. (#1364) Signed-off-by: Mike Griego --- 19.0/apache/entrypoint.sh | 5 +++++ 19.0/fpm-alpine/entrypoint.sh | 5 +++++ 19.0/fpm/entrypoint.sh | 5 +++++ 20.0/apache/entrypoint.sh | 5 +++++ 20.0/fpm-alpine/entrypoint.sh | 5 +++++ 20.0/fpm/entrypoint.sh | 5 +++++ 21.0/apache/entrypoint.sh | 5 +++++ 21.0/fpm-alpine/entrypoint.sh | 5 +++++ 21.0/fpm/entrypoint.sh | 5 +++++ docker-entrypoint.sh | 5 +++++ 10 files changed, 50 insertions(+) diff --git a/19.0/apache/entrypoint.sh b/19.0/apache/entrypoint.sh index bee572c2..b6da893b 100755 --- a/19.0/apache/entrypoint.sh +++ b/19.0/apache/entrypoint.sh @@ -69,6 +69,11 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP else echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\"" fi + echo "redis.session.locking_enabled = 1" + echo "redis.session.lock_retries = -1" + # redis.session.lock_wait_time is specified in microseconds. + # Wait 10ms before retrying the lock rather than the default 2ms. + echo "redis.session.lock_wait_time = 10000" } > /usr/local/etc/php/conf.d/redis-session.ini fi diff --git a/19.0/fpm-alpine/entrypoint.sh b/19.0/fpm-alpine/entrypoint.sh index bee572c2..b6da893b 100755 --- a/19.0/fpm-alpine/entrypoint.sh +++ b/19.0/fpm-alpine/entrypoint.sh @@ -69,6 +69,11 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP else echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\"" fi + echo "redis.session.locking_enabled = 1" + echo "redis.session.lock_retries = -1" + # redis.session.lock_wait_time is specified in microseconds. + # Wait 10ms before retrying the lock rather than the default 2ms. + echo "redis.session.lock_wait_time = 10000" } > /usr/local/etc/php/conf.d/redis-session.ini fi diff --git a/19.0/fpm/entrypoint.sh b/19.0/fpm/entrypoint.sh index bee572c2..b6da893b 100755 --- a/19.0/fpm/entrypoint.sh +++ b/19.0/fpm/entrypoint.sh @@ -69,6 +69,11 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP else echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\"" fi + echo "redis.session.locking_enabled = 1" + echo "redis.session.lock_retries = -1" + # redis.session.lock_wait_time is specified in microseconds. + # Wait 10ms before retrying the lock rather than the default 2ms. + echo "redis.session.lock_wait_time = 10000" } > /usr/local/etc/php/conf.d/redis-session.ini fi diff --git a/20.0/apache/entrypoint.sh b/20.0/apache/entrypoint.sh index bee572c2..b6da893b 100755 --- a/20.0/apache/entrypoint.sh +++ b/20.0/apache/entrypoint.sh @@ -69,6 +69,11 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP else echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\"" fi + echo "redis.session.locking_enabled = 1" + echo "redis.session.lock_retries = -1" + # redis.session.lock_wait_time is specified in microseconds. + # Wait 10ms before retrying the lock rather than the default 2ms. + echo "redis.session.lock_wait_time = 10000" } > /usr/local/etc/php/conf.d/redis-session.ini fi diff --git a/20.0/fpm-alpine/entrypoint.sh b/20.0/fpm-alpine/entrypoint.sh index bee572c2..b6da893b 100755 --- a/20.0/fpm-alpine/entrypoint.sh +++ b/20.0/fpm-alpine/entrypoint.sh @@ -69,6 +69,11 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP else echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\"" fi + echo "redis.session.locking_enabled = 1" + echo "redis.session.lock_retries = -1" + # redis.session.lock_wait_time is specified in microseconds. + # Wait 10ms before retrying the lock rather than the default 2ms. + echo "redis.session.lock_wait_time = 10000" } > /usr/local/etc/php/conf.d/redis-session.ini fi diff --git a/20.0/fpm/entrypoint.sh b/20.0/fpm/entrypoint.sh index bee572c2..b6da893b 100755 --- a/20.0/fpm/entrypoint.sh +++ b/20.0/fpm/entrypoint.sh @@ -69,6 +69,11 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP else echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\"" fi + echo "redis.session.locking_enabled = 1" + echo "redis.session.lock_retries = -1" + # redis.session.lock_wait_time is specified in microseconds. + # Wait 10ms before retrying the lock rather than the default 2ms. + echo "redis.session.lock_wait_time = 10000" } > /usr/local/etc/php/conf.d/redis-session.ini fi diff --git a/21.0/apache/entrypoint.sh b/21.0/apache/entrypoint.sh index bee572c2..b6da893b 100755 --- a/21.0/apache/entrypoint.sh +++ b/21.0/apache/entrypoint.sh @@ -69,6 +69,11 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP else echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\"" fi + echo "redis.session.locking_enabled = 1" + echo "redis.session.lock_retries = -1" + # redis.session.lock_wait_time is specified in microseconds. + # Wait 10ms before retrying the lock rather than the default 2ms. + echo "redis.session.lock_wait_time = 10000" } > /usr/local/etc/php/conf.d/redis-session.ini fi diff --git a/21.0/fpm-alpine/entrypoint.sh b/21.0/fpm-alpine/entrypoint.sh index bee572c2..b6da893b 100755 --- a/21.0/fpm-alpine/entrypoint.sh +++ b/21.0/fpm-alpine/entrypoint.sh @@ -69,6 +69,11 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP else echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\"" fi + echo "redis.session.locking_enabled = 1" + echo "redis.session.lock_retries = -1" + # redis.session.lock_wait_time is specified in microseconds. + # Wait 10ms before retrying the lock rather than the default 2ms. + echo "redis.session.lock_wait_time = 10000" } > /usr/local/etc/php/conf.d/redis-session.ini fi diff --git a/21.0/fpm/entrypoint.sh b/21.0/fpm/entrypoint.sh index bee572c2..b6da893b 100755 --- a/21.0/fpm/entrypoint.sh +++ b/21.0/fpm/entrypoint.sh @@ -69,6 +69,11 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP else echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\"" fi + echo "redis.session.locking_enabled = 1" + echo "redis.session.lock_retries = -1" + # redis.session.lock_wait_time is specified in microseconds. + # Wait 10ms before retrying the lock rather than the default 2ms. + echo "redis.session.lock_wait_time = 10000" } > /usr/local/etc/php/conf.d/redis-session.ini fi diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index bee572c2..b6da893b 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -69,6 +69,11 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP else echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\"" fi + echo "redis.session.locking_enabled = 1" + echo "redis.session.lock_retries = -1" + # redis.session.lock_wait_time is specified in microseconds. + # Wait 10ms before retrying the lock rather than the default 2ms. + echo "redis.session.lock_wait_time = 10000" } > /usr/local/etc/php/conf.d/redis-session.ini fi