awslabs / aws-elasticache-cluster-client-libmemcached

Libmemcached library support for Amazon ElastiCache Memcached Cluster for PHP. The client is available at https://github.com/awslabs/aws-elasticache-cluster-client-memcached-for-php.
Other
26 stars 24 forks source link

Session Lock issue with libmemcached version 1.0.18 #14

Open imthy opened 6 years ago

imthy commented 6 years ago

Hi,

Maintaining session in elasticache worked fine with PHP 5.6 and aws elastic cache cluster client with memcached 2.1.0 and libmemcached 1.0.8. But, after upgrading to PHP 7 and aws elastic cache cluster client with memcached 3.0.3 and libmemcached 1.0.18, facing issues with maintaining session in elasticache. Getting the below error: _sessionstart(): Unable to clear session lock record

Followed the suggestions in many forum's and tried changing the session settings in ini files, but nothing worked.

Any help would be appreciated !!

@QuChen88 @malyeyev-AMZN @subuk @danzamansky @hyandell

sodabrew commented 6 years ago

See https://github.com/php-memcached-dev/php-memcached/issues/399#issuecomment-398444975 for the underlying php-memcached issue and steps to resolve.

woolardfa commented 6 years ago

Made this comment also in #399 - Just an FYI... have tested PHP 7.2 (7.2.6), the underlying issue where session_start returns true when it in fact failed to acquire the session lock, and subsequently corrupts the existing session data, has been fixed.

A call to session_start() now returns false when it failed to acquire the session lock.

ultrageoff commented 5 years ago

Just to mention that an upgrade from PHP 7.1 to 7.2 brought instantly snappier response and an instant fix for the session lock issues I was seeing.

stephenbaugh commented 5 years ago

Just to mention that an upgrade from PHP 7.1 to 7.2 brought instantly snappier response and an instant fix for the session lock issues I was seeing.

@ultrageoff are you using an amazon instance? I tried to upgrade to php 7.2 using apache on the 2108 amazon instance, against elasticache memcache and the amazon auto configure memcached client. This had PHP warnings as 7.2 uses libmemcached 1.0.8. When I downgraded to php 7.0 the warnings stoped as the 7.0 client uses libmemcached 1.0.18

I can't (a) understand why libmemcached was downgraded to a earlier version in the 7.2 client and (b) can't get it to compile due to warnings and therefore building my own isn't possible.

Bit shocked it's 12 months later and the 7.2 client hasn't been updated to a version that uses the later libmemcached version as this must be a widespread issue.

ultrageoff commented 5 years ago

@stephenbaugh I'm on a 'cloud-based' hosting package from TSOhost. I honestly didn't look very deeply into the causes of the issues - beyond reading about the implication of libmemcached versions. As switching up a PHP version was very easy (using TSOhosts control panel, an equivalent to cPanel or similar) and delivered a fix, I thought I'd share. I didn't go into it any further, but thanks for your insight on the version downgrading, which seems likely to be relevant.

stephenbaugh commented 5 years ago

@ultrageoff thanks for the update.