Skip to content
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

[2.3][Process] Use stream based storage to avoid memory issues #17423

Merged

Conversation

romainneutron
Copy link
Contributor

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


if (false === $latest) {
return '';
if ($this->outputDisabled) {
Copy link
Member

Choose a reason for hiding this comment

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

undefined. see tests

Copy link
Contributor Author

Choose a reason for hiding this comment

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

woops, fixed

@romainneutron romainneutron force-pushed the process-use-stream-based-storage-2.3 branch from 7663f4a to 1752677 Compare January 18, 2016 17:25
@@ -378,7 +378,7 @@ public function getOutput()

$this->readPipes(false, '\\' === DIRECTORY_SEPARATOR ? !$this->processInformation['running'] : true);

return $this->stdout;
return (string) stream_get_contents($this->stdout, -1, 0);
Copy link
Member

Choose a reason for hiding this comment

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

casting to string triggers copy-on-writes, it would be better to use an if here

@romainneutron romainneutron force-pushed the process-use-stream-based-storage-2.3 branch from 1752677 to fa37d36 Compare January 18, 2016 18:50
@romainneutron
Copy link
Contributor Author

Comments addressed, PR updated

@romainneutron romainneutron force-pushed the process-use-stream-based-storage-2.3 branch from fa37d36 to da73125 Compare January 19, 2016 10:51
@romainneutron
Copy link
Contributor Author

I just updated the PR, I reduced the temp stream to 1M at max before switching on fs. I've also changed the streams mode from a+ to wb+

@fabpot
Copy link
Member

fabpot commented Jan 19, 2016

👍

@fabpot
Copy link
Member

fabpot commented Jan 20, 2016

Thank you @romainneutron.

@fabpot fabpot merged commit da73125 into symfony:2.3 Jan 20, 2016
fabpot added a commit that referenced this pull request Jan 20, 2016
…sues (romainneutron)

This PR was merged into the 2.3 branch.

Discussion
----------

[2.3][Process] Use stream based storage to avoid memory issues

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

Commits
-------

da73125 [Process] Use stream based storage to avoid memory issues
fabpot added a commit that referenced this pull request Jan 20, 2016
…ge (romainneutron)

This PR was merged into the 2.7 branch.

Discussion
----------

[2.7][Process] Update in 2.7 for stream-based output storage

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

This PR should be rebased once #17423 has been merged. It contains fixes related to methode `Process::getErrorOutput` and `Process::getOutput` that do not exist in branch 2.3

Commits
-------

2d931f4 [Process] Use stream based storage to avoid memory issues
@fabpot fabpot mentioned this pull request Feb 3, 2016
This was referenced Feb 28, 2016
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.

None yet

5 participants