-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Database queries in kernel.terminate are not logged to profiler (only to file) #35382
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
Hey, thanks for your report! |
@carsonbot it is still relevant. |
Hey, thanks for your report! |
@carsonbot it is still not resolved |
Hey, thanks for your report! |
@carsonbot It probably wasn't fixed, but is not affecting my application anymore. |
I run into the same issue. My theory is that the entity manager is closed before this terminate event? I get this error alot when running command and listen to the console.terminate event. |
On Symfony 6.0 issue still exists, IMO profiler should show queries from
Doctrine will throw exception in that case. Edit: |
Hey, thanks for your report! |
Yep, nothing changed. |
Hey, thanks for your report! |
Still not fixed. |
Hey, thanks for your report! |
Still not fixed. |
@PabloKowalczyk would you like to give this a try? Keeping the issue open won't make it solve by itself, someone needs to commit to figuring out a solution. |
I have done some investigation and turns out that profiles are collected on @nicolas-grekas Any ideas how it can be fixed? |
Hey, thanks for your report! |
Friendly ping? Should this still be open? I will close if I don't hear anything. |
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.0.2
Description
Database queries in listeners to
kernel.terminate
event are not logged to profiler, but they are still logged tovar/log/dev.log
. I would expect them to be either in both places or none.I discovered this after I added a listener that saves timestamp of last user activity to database (and I thought it may be a good idea to do it in
kernel.terminate
not to block the response).How to reproduce
src/DemoListener.php
:services.yaml
:(You can use the patch listener.patch.txt )
var/log/dev.log
Possible Solution
Maybe collect the profiler data in
kernel.terminate
? But I guess that would have other consequences.Additional context
I found an opinion that use of
kernel.terminate
is dangerous and should be avoided #27544 (comment) but it is not mentioned in docs.The text was updated successfully, but these errors were encountered: