ongr-io / ElasticsearchBundle

Symfony bundle for Elasticsearch with steroids
MIT License
313 stars 189 forks source link

Connections not properly closed on Kernel shutdown #836

Open applike-ss opened 6 years ago

applike-ss commented 6 years ago

I experience propblems because of too many open connections during unit tests. These connection are at half from ongr which doesn't close the connection on kernel shutdown => Garbage collection doesn't free it.

The used PHP Version is 7.1.12 Elasticsearch is 5.6.0 Bundle is v5.0.5

saimaz commented 6 years ago

Hey @applike-ss can you explain your problem in more detail that I could recreate the problem?

applike-ss commented 6 years ago

@saimaz Yey, we do unit testing with phpunit and do not use the process isolation feature. Doing these tests includes extending WebTestCase and using the createClient method. This boots a kernel which is then shut down after the request is done. In the Bundle Shutdown method the open connections to elastic should be closed, but they are not. If you need more detail, please let me know what you need.

saimaz commented 6 years ago

Ok, got the point. I think it might be related to the elasticsearch client. I'll test it more.

saimaz commented 5 years ago

Well, it's completely related to the ES client side.

applike-ss commented 5 years ago

Yes and the ongr bundle handles the interaction with the client and should close all references on kernel shutdown.

applike-ss commented 5 years ago

@saimaz please re-open