3

I get a strange PHP bug on a PHP 5.6 / Symfony 2.7 project, running on a CentOS6 server through Apache.

I have a Symfony console command running as a service which launches some other console commands every 2 seconds. I use the Symfony Process component to launch the sub-processes and have timeout management. And everything is done to avoid to launch parallel processes from the main command.

The issue I have is that sometimes php console commands doesn't stop after finishing their process. Which means that if I launch by hand the commands, everything runs correctly on the PHP side but I don't get the hand back on the console after the PHP statements finished, unless I use Ctrl+C.

The issue was happening a lot of times when the PHP version was 5.5, but now with PHP 5.6 it (only) happens randomly. When it happens, I can see a lot of stucked php sub-processes, probably launched by the main command.

I just can't find any explanation since php commands doesn't raise any error. It's just that the console get stuck and wait for something to finish.

Has anybody a possible solution to this issue?

luchaninov
  • 6,792
  • 6
  • 60
  • 75
  • 2
    Do you have some code so we can try to reproduce it? – Matheno Nov 19 '15 at 15:48
  • Sadly, no... The command is integrated in a more important project and can't be extracted easily. Moreover, it can't be reproduced easily (even within the whole project). There is no clear reason, error or message which can give us a hint... – Fabien Antoine Nov 19 '15 at 15:59
  • So you can't show us code, you can't provide a replication case, all we have to go on is that thing x happens on your computer? I think you'll be lucky :P – Jonnix Nov 19 '15 at 16:01
  • I know I don't have a lot of informations to offer... The thing is that it doesn't come from some PHP code but from something which lock the process after PHP execution. To be clear, if I put an 'echo' at the very end of the `app/console` file, it will be displayed but the console will get stuck after. It doesn't only occur on my computer but also on my development/staging and production servers. – Fabien Antoine Nov 19 '15 at 16:07
  • At least how do you launch some other commands? – Marek Nov 19 '15 at 16:21
  • The main console command is ran as a service thanks to daemonize. This command launch sub-processes by using Symfony2 Process component. I use the ProcessBuilder class to specify the timeout and the full sub-command (like `php app/console my:command --some-arg`). Then I get the process from the builder and launch it with its `run()` method. – Fabien Antoine Nov 19 '15 at 16:26
  • Any updates on this? I have the same problem now. – movsky Dec 15 '16 at 15:19

0 Answers0