[FrameworkBundle] Remove default value for gc_probability config option#58165
Merged
fabpot merged 1 commit intosymfony:7.2from Sep 4, 2024
Merged
[FrameworkBundle] Remove default value for gc_probability config option#58165fabpot merged 1 commit intosymfony:7.2from
gc_probability config option#58165fabpot merged 1 commit intosymfony:7.2from
Conversation
gc_probability config option
Member
|
Just asking so we can properly document this: the change means that the new default value of Symfony's |
fabpot
approved these changes
Sep 4, 2024
Member
|
Thank you @nicolas-grekas. |
Member
Author
|
@javiereguiluz 💯 this will make it behave like the other session settings |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While playing on a test app, I experienced an error related to the session GC:
This is triggered by StrictSessionHandler calling the gc() method of the native session handler.
I figured out the GC was running with 1/1440 probability so I tried increasing the probability to reproduce. I did so patching my ini settings and this did nothing, until I figured out that the corresponding option shadows the ini settings.
This was done 10 years ago in #10366 (/cc @fabpot) to fix #10349. Re-reading that issue, I think it doesn't apply anymore: by default, we now encourage storing sessions in the folder configured in the ini settings also.
Let's revert that PR.
Then, what about the error itself? It happens because the folder configured on my Ubuntu doesn't have the
xpermission, so that the session GC cannot list its content. This is consistent withsession.gc_probabilitybeing set to0. My host relies on cron instead of this GC. Which means there's nothing else to fix actually.