Skip to content

Memcached with persitent connections segfaults #27299

Closed
@palex-fpt

Description

@palex-fpt

Symfony version(s) affected: 4.0.0

Description
Enabling persistent connections for memcached provider, call to Memcached::createConnection starts throw segfault.

How to reproduce

public function testPersistentConnectionCreation()
	{
		/** @var \Memcached $instance */
		$instance = MemcachedCache::createConnection("memcached://localhost", ['persistent_id' => 'persistent']);
		$this->assertCount(1, $instance->getServerList());

		$instance = MemcachedCache::createConnection("memcached://localhost", ['persistent_id' => 'persistent']);
		$this->assertCount(1, $instance->getServerList()); // fail here. 

		// disabling previous assert leads to segfault due libmemcached-1.0.18 bug
		$instance = MemcachedCache::createConnection("memcached://localhost", ['persistent_id' => 'persistent']);
		$this->assertCount(1, $instance->getServerList());
	}

Possible Solution
MemcachedTrait::createConnection should not add server to lists of servers when connection is not pristine and its servers list equals to configuration list

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions