Bug #9790

APC-based class loader should use unique prefix

Added by Jesús García Crespo about 6 years ago. Updated about 6 years ago.

Status:VerifiedStart date:05/03/2016
Priority:HighDue date:
Assignee:David Hume% Done:

0%

Category:Internals
Target version:Release 2.3.0
Google Code Legacy ID: Tested version:2.2, 2.3
Sponsored:No Requires documentation:

Description

AtoM does not guarantee uniqueness in the prefix of the namespace class loader. See:

  protected function namespacesClassLoader()
  {
    if (extension_loaded('apc'))
    {
      $loader = new ApcUniversalClassLoader('atom');
    }
    else
    {
      $loader = new UniversalClassLoader();
    }
    $loader->registerNamespaces(array(
      'Elastica' => __DIR__.'/../vendor/elastica'));
    $loader->register();
  }

The prefix is set always to "atom". We detected this problem in a machine where we had two instances of AtoM running where one of them was running an upgraded version of Elastica. The older version had more traffic causing the older files being cached first.

It is important to remember that both PHP and OPCache are held by the master PHP-FPM process. That means that setting up two different pools will NOT solve the problem. You should set up two different PHP-FPM services instead (=> two masters), but that won't be necessary once we fix the original issue: the lack of uniqueness in the prefix.

History

#2 Updated by Jesús García Crespo about 6 years ago

  • Status changed from New to Code Review
  • Assignee changed from Jesús García Crespo to José Raddaoui Marín

#4 Updated by Jesús García Crespo about 6 years ago

  • Description updated (diff)

#5 Updated by José Raddaoui Marín about 6 years ago

  • Status changed from Code Review to Feedback
  • Assignee changed from José Raddaoui Marín to Jesús García Crespo

Wonderful!

#6 Updated by Jesús García Crespo about 6 years ago

  • Status changed from Feedback to QA/Review
  • Assignee changed from Jesús García Crespo to David Hume

@dhume I think that you are in best position to verify if this fix works, thanks!

#7 Updated by Jesús García Crespo about 6 years ago

  • Status changed from QA/Review to Verified

Also available in: Atom PDF