php-pm / php-pm-httpkernel

HttpKernel adapter for use of Symfony and Laravel frameworks with PHP-PM
MIT License
246 stars 72 forks source link

Weird behaviour after doctrine-bundle update 2.0.6 #161

Open acasademont opened 4 years ago

acasademont commented 4 years ago

Just to keep track of it, seems like the new doctrine-bundle default behaviour interferes with our clear or reset strategy we have in the Symfony bootstrap.

https://github.com/doctrine/DoctrineBundle/issues/1114

dnna commented 4 years ago

That looks strange indeed. I'll try to have a look in the next few days, as this will probably affect my projects as well after upgrading. The PHP-PM code itself doesn't look wrong, it only resets if the entity manager is not open (e.g. an exception occurred that closed it), otherwise it only clears the existing one.

dnna commented 4 years ago

Btw, if DoctrineBundle now performs its own reset we should probably remove our reset logic in PHP-PM's postHandle or make it conditional on Doctrine\Bundle\DoctrineBundle\Registry not having ResetInterface. Otherwise we are resetting twice now.

acasademont commented 4 years ago

yes, exactly, it's as easy as to check if the doctrine service is implementing the ResetInterface or not

mathieudz commented 4 years ago

I'm having memory leaks after upgrading from doctrine-bundle 2.0.2 to 2.0.6. Workers reach max memory after 500 requests while the workers are only restarted after 1000 requests. I've downgraded it back to 2.0.2

acasademont commented 4 years ago

Interesting side effect, I didn’t even notice. I’m going to check our production logs. In any case, we too reverted to 2.0.2

On Tue, 24 Dec 2019 at 22:00, Mathieu De Zutter notifications@github.com wrote:

I'm having memory leaks after upgrading from doctrine-bundle 2.0.2 to 2.0.6. Workers reach max memory after 500 requests while the workers are only restarted after 1000 requests. I've downgraded it back to 2.0.2

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/php-pm/php-pm-httpkernel/issues/161?email_source=notifications&email_token=AAGJNPO2VVEMIX5LNGELZVTQ2JZ6PA5CNFSM4J6VOTZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHTTT5I#issuecomment-568801781, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGJNPMV5SVFXISPQDG744TQ2JZ6PANCNFSM4J6VOTZQ .

acasademont commented 4 years ago

@mathieudz didn't see any memory limit crashes on our logs. Still, we should also keep an eye on it.