-
Notifications
You must be signed in to change notification settings - Fork 8
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
Sockets are never closed with symfony profiler activated #3
Comments
I tried to reproduce this but I have some issues with my docker installation.
I created a repo for this bug: https://github.com/Nyholm/php-http-logger-bug-3 |
@Nyholm thanks for your time. I setup a docker env and completed the readme to make it working. But on your sample, I can't reproduce the issue. It's very weird because on my project, I have the issue right after adding the logger plugin on the client... Any idea? |
How is configured monolog ? |
On monolog:
handlers:
main:
type: rotating_file
date_format: 'Y-m'
max_files: 2
path: '%kernel.logs_dir%/%kernel.environment%.log'
level: debug
channels: ['!event']
console:
type: console
process_psr_3_messages: false
channels: ['!event', '!doctrine', '!console']
# To follow logs in real time, execute the following command:
# `bin/console server:log -vv`
server_log:
type: server_log
process_psr_3_messages: false
host: 127.0.0.1:9911 On
No common configuration. |
Can you try to remove this configuration :
and see if you have still this bug ? |
@joelwurtz Just did it, nothing changed. |
I did a full copy of my personal project and remove most of the code to try to isolate the issue: https://github.com/Nyholm/php-http-logger-bug-3/tree/project-case And I think I got a new clue. If you remove this config part: # app/config/config_dev.yml
framework:
profiler: { only_exceptions: false } The issue is not reproducible anymore. So it seems to be related to the Symfony profiler. But why? What do you think? Regards. |
Great. Im not sure why this is. If I may make a guess I would assume that the profiler temporary stores logs somewhere. |
I suppose to, but for now I simply deactivated logging on the docker client: httplug:
plugins:
logger: ~
clients:
default:
factory: 'httplug.factory.guzzle6'
plugins: ['httplug.plugin.logger']
docker:
factory: 'httplug.factory.docker'
# plugins: ['httplug.plugin.logger']
profiling:
captured_body_length: 1000 |
Actual Behavior
When you create a socket client with a logger plugin and make multiple requests, the opened files number is contently increasing.
Expected Behavior
The opened files should be stable, as it is without the logger plugin
Steps to Reproduce
Here is the test file:
I did a test on my Symfony project setup. Here is the test file:
The httplug bundle configuration:
The docker client special services:
The
CallableClientFactory
class (see php-http/HttplugBundle#210 (comment)):And the
DockerClient
from the vendor: https://github.com/docker-php/docker-php/blob/1.24.0/src/DockerClient.php#L11-L34As you can see, the Socket client is used here.
The installer httplug packages:
Here is the output of the test script:
The number of opened files is always increasing.
If I remove the
plugins: ['httplug.plugin.logger']
line from the docker client configuration and run the script again:The number of opened fine is perfectly constant.
I opened an issue here because the only relation I found is this plugin, but I don't know if it's caused directly by this one, or the socket client or even a bad usage of this one.
What do you think?
cc @joelwurtz, maintainer of docker-php project.
The text was updated successfully, but these errors were encountered: