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: [Memcached] session_start(): Unable to clear session lock record #7604

Open
sandeep190 opened this issue Jun 21, 2023 · 4 comments
Open
Labels
bug Verified issues on the current code behavior or pull requests that will fix them

Comments

@sandeep190
Copy link

sandeep190 commented Jun 21, 2023

PHP Version

8.2

CodeIgniter4 Version

4.3.2

CodeIgniter4 Installation Method

Composer (using codeigniter4/appstarter)

Which operating systems have you tested for this bug?

Linux

Which server did you use?

fpm-fcgi

Database

Mysql 5.7

What happened?

I have configured session store as memcached, it was working fine in PHP 7.1 with codeIgniter 2,

After upgrading PHP 7.1 to 8.2 and codeIgniter 2 to 4 I am getting an error on multiple async ajax call

session_start(): Unable to clear session lock record
in SYSTEMPATH/Session/Session.php on line 928.
 1 [internal function]: CodeIgniter\Debug\Exceptions->errorHandler()
 2 SYSTEMPATH/Session/Session.php(928): session_start()
 3 SYSTEMPATH/Session/Session.php(250): CodeIgniter\Session\Session->startSession()
 4 SYSTEMPATH/Config/Services.php(674): CodeIgniter\Session\Session->start()
 5 SYSTEMPATH/Config/BaseService.php(252): CodeIgniter\Config\Services::session()
 6 SYSTEMPATH/Config/BaseService.php(193): CodeIgniter\Config\BaseService::__callStatic()
 7 SYSTEMPATH/Config/Services.php(641): CodeIgniter\Config\BaseService::getSharedInstance()
 8 SYSTEMPATH/Config/BaseService.php(252): CodeIgniter\Config\Services::session()
 9 SYSTEMPATH/Common.php(988): CodeIgniter\Config\BaseService::__callStatic()

codeIgniter official website also suggests to use session_write_close() for resolving this issue. But this did not work for ajax concurrent call.

Steps to Reproduce

When I am calling multiple sync ajax than getting error

Expected Output

Getting Json Response

Anything else?

No response

@sandeep190 sandeep190 added the bug Verified issues on the current code behavior or pull requests that will fix them label Jun 21, 2023
@kenjis kenjis changed the title Bug: Bug: session_start(): Unable to clear session lock record Jun 21, 2023
@kenjis
Copy link
Member

kenjis commented Jun 21, 2023

Do you use the same version of Memcached with CI2 and CI4?

@kenjis
Copy link
Member

kenjis commented Jun 21, 2023

Try:

[memcached]
memcached.sess_lock_wait_min = 100;
memcached.sess_lock_wait_max = 1000;
memcached.sess_lock_retries = 30;

@sandeephealthians190
Copy link

Do you use the same version of Memcached with CI2 and CI4?

yes I am using same version of memcached 1.6.6

@kenjis kenjis changed the title Bug: session_start(): Unable to clear session lock record Bug: [Memcached] session_start(): Unable to clear session lock record Jun 23, 2023
@kenjis
Copy link
Member

kenjis commented Dec 12, 2023

See bcit-ci/CodeIgniter#5382

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

No branches or pull requests

3 participants