dancryer / PHPCI

PHPCI is a free and open source continuous integration tool specifically designed for PHP.
BSD 2-Clause "Simplified" License
2.42k stars 441 forks source link

Proc Open deadlock #1322

Closed Fenikkusu closed 6 years ago

Fenikkusu commented 7 years ago

Contribution Type: bug fix Link to Intent to Implement: N/A Link to Bug: N/A

This pull request affects the following areas:

In raising this pull request, I confirm the following (please check boxes):

Detailed description of change:

When running on a 7.0 repo, I found that it the phpunit test would hang indefinately. When I ran the command directly in the command line, the command ran but died instantly. After a score of R&D, I finally learned that proc_open has a bug in it where if there is a ton of output on both stdout and stderr at the same time, a dead-lock occurs where one is effectively waiting on the other to finish. This change fixes that converting the processing to be non-blocking and instead relying on PHP to check the status. This bypasses the dead-lock and allows the code to run as expected.