Skip to content

[2.1][Process] Fix timeout in Process::stop method #7580

Merged
merged 1 commit into from Apr 7, 2013

4 participants

@romainneutron
Symfony member
Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #7579
License MIT
  • The timeout is ten times more than set.
  • The timeout does not occurs, it is actually blocking until the process dies.
@pborreli pborreli commented on an outdated diff Apr 6, 2013
...ymfony/Component/Process/Tests/NonStopableProcess.php
@@ -0,0 +1,37 @@
+<?php
+
+/**
+ * Runs a PHP script that can be stop only with a SIGKILL (9) signal for 3 seconds
@pborreli
pborreli added a note Apr 6, 2013

stopped ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@stof stof commented on an outdated diff Apr 6, 2013
...mfony/Component/Process/Tests/AbstractProcessTest.php
+ if (defined('PHP_WINDOWS_VERSION_BUILD')) {
+ $this->markTestSkipped('Stop with timeout does not work on windows, it requires posix signals');
+ }
+ if (!function_exists('pcntl_signal')) {
+ $this->markTestSkipped('This test require pcntl_signal function');
+ }
+
+ // exec is mandatory here since we send a signal to the process
+ // see https://github.com/symfony/symfony/issues/5030 about prepending
+ // command with exec
+ $p = $this->getProcess('exec php '.__DIR__.'/NonStopableProcess.php 3');
+ $p->start();
+ usleep(100000);
+ $start = microtime(true);
+ $p->stop(1.1);
+ while($p->isRunning()) {
@stof
Symfony member
stof added a note Apr 6, 2013

missing space

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@romainneutron romainneutron Fix timeout in Process::stop method
 - The timeout is ten times more than set.
 - The timeout does not occurs, it is actually blocking until the process dies.
bec8ff1
@fabpot fabpot added a commit that referenced this pull request Apr 7, 2013
@fabpot fabpot merged branch romainneutron/process-timeout (PR #7580)
This PR was merged into the 2.1 branch.

Discussion
----------

[2.1][Process] Fix timeout in Process::stop method

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #7579
| License       | MIT

- The timeout is ten times more than set.
- The timeout does not occurs, it is actually blocking until the process dies.

Commits
-------

bec8ff1 Fix timeout in Process::stop method
ebbb96e
@fabpot fabpot merged commit bec8ff1 into symfony:2.1 Apr 7, 2013

1 check failed

Details default Scrutinizer: 1 Comments, 0 Changed Files — Travis: Passed
@romainneutron romainneutron deleted the romainneutron:process-timeout branch Apr 7, 2013
@mmucklo mmucklo pushed a commit that referenced this pull request May 23, 2013
@fabpot fabpot merged branch romainneutron/process-timeout (PR #7580)
This PR was merged into the 2.1 branch.

Discussion
----------

[2.1][Process] Fix timeout in Process::stop method

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #7579
| License       | MIT

- The timeout is ten times more than set.
- The timeout does not occurs, it is actually blocking until the process dies.

Commits
-------

bec8ff1 Fix timeout in Process::stop method
544783e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.