Skip to content

[Process] Remove enhanced sigchild compatibility #23380

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 12, 2017

Conversation

maidmaid
Copy link
Contributor

@maidmaid maidmaid commented Jul 4, 2017

Q A
Branch? master
Bug fix? no
New feature? no
BC breaks? yes
Deprecations? no
Tests pass? yes
Fixed tickets #23376 (comment), #22836 (comment)
License MIT
Doc PR /

In 4.0, enhanced sigchild compatibility is always enabled.

Copy link
Member

@xabbuh xabbuh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests are failing

@xabbuh xabbuh added this to the 4.0 milestone Jul 4, 2017
@maidmaid maidmaid force-pushed the process-sigchild-4 branch 5 times, most recently from 194c2ce to 00647fa Compare July 4, 2017 13:15
@maidmaid
Copy link
Contributor Author

maidmaid commented Jul 4, 2017

Could you help me to fix tests?

@xabbuh
Copy link
Member

xabbuh commented Jul 4, 2017

I am afraid I will not be of much help here (I tried to do that before in #22836 but then excluded this part as I didn't manage to make the tests pass)

@maidmaid
Copy link
Contributor Author

maidmaid commented Jul 4, 2017

Ok, I see your previous comment here #22836 (comment). I'll try more...

@nicolas-grekas nicolas-grekas self-requested a review July 11, 2017 07:00
* @throws ProcessFailedException if the process didn't terminate successfully
*
* @final since version 3.3
*/
public function mustRun(callable $callback = null, array $env = array())
{
if (!$this->enhanceSigchildCompatibility && $this->isSigchildEnabled()) {
throw new RuntimeException('This PHP has been compiled with --enable-sigchild. You must use setEnhanceSigchildCompatibility() to use this method.');
if ($this->isSigchildEnabled()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this if block should be removed (and the annotation above)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

*/
public function getExitCode()
{
if (!$this->enhanceSigchildCompatibility && $this->isSigchildEnabled()) {
throw new RuntimeException('This PHP has been compiled with --enable-sigchild. You must use setEnhanceSigchildCompatibility() to use this method.');
if ($this->isSigchildEnabled()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to be remove, also the related line in the docblock

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

@@ -723,7 +721,7 @@ public function hasBeenSignaled()
{
$this->requireProcessIsTerminated(__FUNCTION__);

if (!$this->enhanceSigchildCompatibility && $this->isSigchildEnabled()) {
if ($this->isSigchildEnabled()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

}

if ($expectException) {
if (method_exists($this, 'expectException')) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is wrong. All the logic setting an expected exception was triggered only inside a self::$notEnhancedSigchild. And now, sigchild compat is always enhanced. So this if must become a if (false), not a if (true)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok but... I'm not sure I'll be able to fix this alone... Could you show me what I need to do more exactly please?

@stof
Copy link
Member

stof commented Jul 11, 2017

Tests are failing because half of the places removing the usage of the field in conditionals performed the wrong replacement, making the code equivalent to disabling enhanced compat all the time instead of enabling it all the time.

@maidmaid maidmaid force-pushed the process-sigchild-4 branch from 00647fa to 7838da4 Compare July 11, 2017 11:11
@@ -420,7 +419,7 @@ public function testExitCodeCommandFailed()
if ('\\' === DIRECTORY_SEPARATOR) {
$this->markTestSkipped('Windows does not support POSIX exit code');
}
$this->skipIfNotEnhancedSigchild();
$this->skipIfSigchildEnabled();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all these should be just removed

@@ -1517,19 +1501,21 @@ private function getProcessForCode($code, $cwd = null, array $env = null, $input
return $this->getProcess(array(self::$phpBin, '-r', $code), $cwd, $env, $input, $timeout);
}

private function skipIfNotEnhancedSigchild($expectException = true)
private function skipIfSigchildEnabled($expectException = true)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this method should be removed

@@ -716,17 +703,12 @@ public function isSuccessful()
*
* @return bool
*
* @throws RuntimeException In case --enable-sigchild is activated
* @throws LogicException In case the process is not terminated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cs fix required, see fabbot

@maidmaid maidmaid force-pushed the process-sigchild-4 branch from 7838da4 to 65501b7 Compare July 12, 2017 12:02
@maidmaid maidmaid force-pushed the process-sigchild-4 branch from 65501b7 to 1aa7d68 Compare July 12, 2017 12:15
@maidmaid
Copy link
Contributor Author

Green tests!

@nicolas-grekas
Copy link
Member

Thank you @maidmaid.

@nicolas-grekas nicolas-grekas merged commit 1aa7d68 into symfony:master Jul 12, 2017
nicolas-grekas added a commit that referenced this pull request Jul 12, 2017
…maid)

This PR was merged into the 4.0-dev branch.

Discussion
----------

[Process] Remove enhanced sigchild compatibility

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | yes
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #23376 (comment), #22836 (comment)
| License       | MIT
| Doc PR        | /

In 4.0, enhanced sigchild compatibility is always enabled.

Commits
-------

1aa7d68 Remove enhance sigchild compatibility
@maidmaid maidmaid deleted the process-sigchild-4 branch July 12, 2017 13:13
@fabpot fabpot mentioned this pull request Oct 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants