toni-moreno / syncflux

SyncFlux is an Open Source InfluxDB Data synchronization and replication tool for migration purposes or HA clusters
MIT License
154 stars 34 forks source link

add close connection to avoid thousands of conns open #30

Closed maxadamo closed 4 years ago

maxadamo commented 4 years ago

I have noticed too many connections open and I found that the ping test was not closing the connections.

maxadamo commented 4 years ago

resolves #31

toni-moreno commented 4 years ago

Hello @maxadamo sorry for the delay in this answer, and thank you very much for your contribution.

Prior to merge I would like to discuss a little about this "close()". I did no review all the code, and right now I have not enough time to spend in testing this changes. I will be grateful if you can do these test yourself.

I will add comments on the code.

maxadamo commented 4 years ago

Before making this change, a new connection was added every 10 seconds (the check interval) and it was never released. I found 7 thousand connections open. Now it works, and I see only one connection. p.s.: when the the recover happens a new connection is added and it's not being closed... we may need to find where the other Close() is missing, but this is less dangerous, because the recover does not happen every 10 seconds and we can take it easier.

toni-moreno commented 4 years ago

Hi @maxadamo still thinking on this issue. In a few weeks I will do some tests and if no better solution found I will merge your PR.