1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Service Issue Memcache Based Session Fails If Any ("Redundant") Server Is Down

Discussion in 'Resolved Bug Reports' started by digitalpoint, May 3, 2013.

  1. digitalpoint

    digitalpoint Well-Known Member

    Memcache has built in fault tolerance via the PHP extension's addServer() connection pool (which Zend/XF uses just fine).

    If any one memcache server is down, the XF's session causes a fatal error even though nothing is actually wrong on the backend end (again... the PHP extension handles failover of the memcache cluster internally).

    It looks like the Zend_Session class already has the ability to not fail on a startup exception (more specifically in this case I believe it's a PHP notice that's being treated as a fatal exception). Info on the same issue here: http://framework.zend.com/issues/browse/ZF-6848

    It looks like the two session start lines in XenForo_Session could be changed to this (since the start() method already allows passing in the throw_startup_exceptions option):

    $session->start(array('throw_startup_exceptions' => E_ALL E_NOTICE));
    Long story short is if one memcache server goes down, the failover is already handled in PHP, but XF will end up with fatal error for any page the way it is now.
    Adam Howard likes this.
  2. Mike

    Mike XenForo Developer Staff Member

    The workaround here is to specify a failure_callback with an empty function in the configuration of the servers. Otherwise, the memcache library itself issues a notice which ends up getting caught by our error handling.

    I'd recommend the failure_callback setting.
  3. HWS

    HWS Well-Known Member

    'failure_callback' => ''
    to the memcache config in config.php
    results in an error.

    Is there a better way to add failure_callback correctly?

Share This Page