-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Console][Process] Free process resources #44882
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
Conversation
Hey! I see that this is your first PR. That is great! Welcome! Symfony has a contribution guide which I suggest you to read. In short:
Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change. When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor! I am going to sit back now and wait for the reviews. Cheers! Carsonbot |
4a29974
to
454ce55
Compare
You say that this doesn't fix anything for you, isn't it? |
Cannot say it does not fix anything but it is not sufficient to fix the issue I am experiencing. |
I am going by the docs, which say “[return value] should be freed using proc_close() when you are finished with it” |
Hi, Same here, since upgrading to SF 5.3.13, my PHPUnit test suite fails with :
I'll try to set up a reproducer |
@adrienfr do you know the previous version of dependencies? Also I am not completely sure Symfony is responsible, might also be PHPUnit or something else. |
I can confirm this is SF related, no more issues when downgrading to previous version. I also tested on SF 5.4.2, the issue is also here.
Might not be able to provide a reproducer thus, got 4733 tests and it fails at 14-15%. Do you have any idea how to process? Should I create a dedicated issue on GitHub with the error message |
I would try installing the dependencies with |
Thanks @jtojnar for your help!
|
I created an issue (#44900) so other users can find it and for better tracking. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm 👎 here because this is not needed: PHP closes resources automatically when they are destructed. Also because right now this is a guess that would need a proof to turn into a merge.
#44900 looks like a better start to find the underlying issue. @jtojnar does you issue happen when HttpClient is used? Is it fixed when you revert to an older version of it?
I have not seen any much documentation an PHP resource management other than
As mentioned in the other thread, I do not have HttpClient in my use case. I did some more digging and it appears that |
I confirmed that the leak originates from this line:
We need to |
It seems that the test suite that triggers my issue caches configuration object for each new test. Since each configuration creates a new On Symfony site, this could be prevented by caching the file descriptor of |
Or by using the STDOUT const on the cli sapi I guess? Can you give it a try and see if that fixes your issue? |
Closing in favor of #45053 |
…too many file descriptors (nicolas-grekas) This PR was merged into the 4.4 branch. Discussion ---------- [Console] use STDOUT/ERR in ConsoleOutput to save opening too many file descriptors | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #44882 | License | MIT | Doc PR | - /cc @jtojnar can you please give this patch a try and report back? Commits ------- 6eaf9e6 [Console] use STDOUT/ERR in ConsoleOutput to save opening too many file descriptors
I am experiencing
Failed to open stream: Too many open files
error when running tests. Sincelsof
shows new/dev/pts/1
being added every second, I tried closing the open processes and also squizlabs/PHP_CodeSniffer#3523 but to no avail. But it is a good practice nonetheless.