Closed
Description
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