Skip to content

Commit 8c624ac

Browse files
committed
update README.md with Known Caveats section
1 parent bb25e42 commit 8c624ac

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,21 @@ Available query params:
4545
Currently only a single host definition is supported.
4646

4747

48+
## Known Caveats
49+
50+
### Using RedisSessionHandler with the `max_execution_time` directive set to `0` is not recommended
51+
52+
Whenever it can, the handler uses the `max_execution_time` directive as a hard timeout for the session lock. This is a
53+
last resort mechanism to release the session lock even if the PHP process crashes and the handler fails to do it itself.
54+
55+
When `max_execution_time` is set to `0` (meaning there is no maximum execution time) this kind of hard timeout cannot be used, as the lock
56+
must be kept for as long as it takes to run the script, which is an unknown amount of time. This means that if for some unexpected reason
57+
the PHP process crashes and the handler fails to release the lock there would be no safe net and you'd end upwith a dangling lock
58+
that you'd need to delete manually.
59+
60+
So when using RedisSessionHandler it is advised _not_ to disable `max_execution_time`.
61+
62+
4863
## Motivation
4964

5065
The Redis session handler bundled with [phpredis](https://github.com/phpredis/phpredis) has had a couple of rather serious

0 commit comments

Comments
 (0)