-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
symfony/console 5.4.12 make db Too many connection errors #47566
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
Comments
Can you create a small example application that allows to reproduce your issue? |
It is gonna be hard to create that I think, even on my project, it happen on specific context. MariaDB [(none)]> SHOW FULL PROCESSLIST; But with symfony/console 5.4.11, it more like: The max_connection for db is 100, that would mean it reach it. I think it's happen during our tests because some of them reset the db and fixture running a console command. But I think it could happen on prod with project that run often symfony console command ? |
I am afraid that without being able to debug we won't be able to help here and you would need to try to find the root cause (and maybe submit a PR then based on your findings). |
I tryed to dig more into my problem but I'm not very confortable understanding deep code of the component, but here my deductions. It seem the mysql process "leak" comme from the php function pcntl_signal() https://github.com/symfony/console/blob/c072aa8f724c3af64e2c7a96b796a4863d24dba1/SignalRegistry/SignalRegistry.php#L37 Before 5.4.12 it seem the $this->signalRegistry->register() was never call because of the condition if ($command instanceof SignalableCommandInterface) I don't understand well the behavior of the function pcntl_signal but my current lead will be that this function mess up when multiple console application->run are done in clause range. In my context, our functionnals tests need to reset db fixtures after data insert/update/delete, so we have something like:
We have 3 differents db and it seem the mysql process is well terminate only for the last db we call the command, the 2 others stack new process each time a test reload the fixture. I'm aware our use case may be very specific but I think It can be a problem for other case. |
We are using Spryker and do an import every night of around 250.000 items. The v5.4.12 seems to have the same issue. So we downgraded to v.5.4.10. We don't get any error. Our staging system now runs 10 minutes slower but the production system has like 3 times more load and fails in the end. |
Hey, thanks for your report! |
@Kleinast ping? |
At the end we refacto this part of our code to drasticly less call the db reset command, so we don't have this error anymore but doesn't mean the problem not potentialy there anymore. But I can't investigate more on this now, so I think you can close this issue. |
Just to note that we didn't find a solution for spryker and pinned the package to 5.4.11. We hope it goes away if Spryker updates to Symfony 6. |
@kfrohwein To be clear from your comments, both @Kleinast You experienced the defect at patch Genesis:
Breaking Change (Per Anecdotal Reports / Not Confirmed): Authors are @xabbuh and @GwendolenLynch. Change was committed by @nicolas-grekas. Any keen insight(s), ponderings, brain dumps, from anyone in that trio? 🥺 @kfrohwein @Kleinast It was emphasized to you by @xabbuh above, and I'll re-emphasis what I believe the sentiment in the communication to be: This issue is will not resolved as-is. We need more contextual information -- even just a little, to bring us closer to solving this! Anything is better than nothing and super appreciated! If you don't have time, etc., to create a failing use case, as was requested above by @xabbuh, could you maybe add some "low hanging fruit" (high value, low effort, info) into this issue? Examples:
Thanks ya'll! 🥇 P.S. @weaverryan big fan of SymfonyCasts bro, have you heard (whispers?) of this issue at all??? |
For context, when I hit the problems in #45332, it was working on commands doing large long-running PostgreSQL jobs. It is too long ago now, but I seem to remember hitting something similar when writing my tests. Something to do with |
Took a look in our git. It's right now pinned to "symfony/console": "v5.4.10", And the largest number we did use was "symfony/console": "^v5.4.17", 5.4.11 as far as I remember should work as you just changed comments. From 5.4.12 our nightly import is like 20% slower but it is unknown why. If I understand the changes correctly you did change how the signals are registered. But I do not see any reason why this should slow down anything. |
Hey, thanks for your report! |
Hello? This issue is about to be closed if nobody replies. |
Hey, I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen! |
Symfony version(s) affected
5.4.12
Description
I upgrade symfony/console to last version (5.4.12) and lots of my functionnal tests doesn't work anymore because of error like:
Really wird problem but I don't have it with symfony/console 5.4.11.
Is it possible there is a problem in symfony/console@v5.4.11...v5.4.12 ?
How to reproduce
Run lot of functionnals tests on a project with symfony/console 5.4.12 installed
Possible Solution
No response
Additional Context
It is not happened when only one tests is run.
The text was updated successfully, but these errors were encountered: