Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] session.gc_probability=0 prevents sess_ files from being cleaned up #240

Open
alxwr opened this issue Feb 13, 2024 · 0 comments
Open
Assignees
Labels

Comments

@alxwr
Copy link
Member

alxwr commented Feb 13, 2024

Your setup

Formula commit hash / release tag

PHP 8.3 on FreeBDF

Versions reports (master & minion)

salt-minion 3006.5 (Sulfur)

Pillar / config used

---
php:
  version: 8.3

Bug details

Describe the bug

/tmp/sess_3feb24ddb4cc09b051e3c0f09486b046
/tmp/sess_21728c8ea457439fcefeb886c42063fa
/tmp/sess_a8f17e831566f72c767b3f9880252dcf
/tmp/sess_b7043455a7949dadd95168a68bb6bffd

Millions of them.

# find /tmp -name 'sess_*' | wc -l
5570964

Steps to reproduce the bug

Leave the formula as it is. Wait.

Expected behaviour

GC works.

Attempts to fix the bug

---
php:
  version: 8.3
  ini:
    defaults:
      Session:
        session.gc_probability: 1
        session.gc_divisor: 100

To really speed things up for testing:

---
php:
  version: 8.3
  ini:
    defaults:
      Session:
        session.gc_probability: 1
        session.gc_divisor: 1
        session.gc_maxlifetime: 10

Now the number goes steadily down. :-)

# find /tmp -name 'sess_*' | wc -l
5118795
# find /tmp -name 'sess_*' | wc -l
4908084

Additional context

https://www.php.net/manual/en/session.configuration.php#ini.session.gc-probability

@alxwr alxwr added the bug label Feb 13, 2024
@alxwr alxwr self-assigned this Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant