Kunstmaan / kStrano

kStrano (KumaStrano) is a Capistrano deployment “recipe” for Kunstmaan specific applications to make our job of deploying a lot easier. It integrates with Airbrake, Jenkins and Campfire.
MIT License
13 stars 0 forks source link

apcclear.php still needed #41

Closed SpoBo closed 11 years ago

SpoBo commented 11 years ago

We noticed on our servers that when apcclear.php is not executed the fpm process will look for its sourcefiles in a different directory. Oddly enough in the oldest one.

apache error log:

[Thu Aug 01 11:32:26 2013] [error] [client 81.82.210.70] FastCGI: server "/home/projects/bancontactcoc/php5-fpm/php5.external" stderr: PHP message: PHP Warning:  require(/home/projects/bancontactcoc/data/releases/20130725143301/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php): failed to open stream: No such file or directory in /home/projects/bancontactcoc/data/releases/20130801092251/app/bootstrap.php.cache on line 749
[Thu Aug 01 11:32:26 2013] [error] [client 81.82.210.70] FastCGI: server "/home/projects/bancontactcoc/php5-fpm/php5.external" stderr: PHP message: PHP Fatal error:  require(): Failed opening required '/home/projects/bancontactcoc/data/releases/20130725143301/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/projects/bancontactcoc/data/releases/20130801092251/app/bootstrap.php.cache on line 749
[11:32:28][bancontactcoc@war /home/vincent]$ ls -la /home/projects/bancontactcoc/data/releases/
total 64
drwxrwx---+  8 bancontactcoc bancontactcoc 4096 Aug  1 11:24 .
drwxrwx---+  5 bancontactcoc bancontactcoc 4096 Aug  1 11:23 ..
drwxrwx---+ 10 bancontactcoc bancontactcoc 4096 Jul 26 09:33 20130726073306
drwxrwx---+ 10 bancontactcoc bancontactcoc 4096 Jul 26 09:40 20130726074026
drwxrwx---+ 10 bancontactcoc bancontactcoc 4096 Jul 26 09:55 20130726075500
drwxrwx---+ 10 bancontactcoc bancontactcoc 4096 Jul 29 14:43 20130729124304
drwxrwx---+ 10 bancontactcoc bancontactcoc 4096 Jul 31 09:14 20130731071430
drwxrwx---+ 10 bancontactcoc bancontactcoc 4096 Aug  1 11:23 20130801092251

As you can see 20130725143301 does not exist.

vincent@war:~$ curl war.cloud.kunstmaan.com/apcclear.php
{"success":true}

After this it starts working.

I assume commit 29896dafe74c9f80c22f526f473c4e3fb605c4fc should be reverted?

kimausloos commented 11 years ago

The statscache (the one realpath() functions use for example) is always shared between pools, so calling the apcclear() will clear that cache so the new deploy paths will be updated.

The opcache and usercache however, is not shared between pools with our configuration. The current fix to kill all pool processes makes sure the ApcClassLoader we use in our app.php clears all those entries so the changes on the Symfony level are picked up as well.

So in conclusion: yes, we need both.