-
Notifications
You must be signed in to change notification settings - Fork 241
Open connections increasing without cleaning up #37
Comments
We have had that problem actually. Calling Can you try your logic without |
I just read this:
BUT - |
here's the fix: 1468aa8 |
@rickfast The ping change looked like it worked; I applied the same logic to the session renewal (which had the same issue) and put up a PR. With both changes, this issue would be resolved for us |
Cool. Nice find. I'll go in and find all of the other possible places the connections aren't being closed. I will cut you guys a release (0.9.7) right now. |
|
cool thanks dude! |
I am using consul to maintain a resource lock. My basic logic is:
run, Consul.newClient(), and cache it
run consul.sessionClient.createSession() and cache it
run consul.keyValueClient().aquireLock()
once that is done I have a loop that every second runs:
consul.agentClient().ping()
consul.sessionClient().renewSession(...)
consul.keyValueClient().getSession(key)
... .isPresent()
.. .get() == session from above
This all works great in go, but in java I see the connections to consul's port go up, down, then up again, then up without bound (up to 1000's of connections) before consul stops accepting connections. It is almost as if the WebTargets from getValue() calls are being persisted by the java garbage collector and since WebTarget does not implement a "close" method eventually java persists hundreds of connections. I am working on trying out this theory but I was hoping that you already had an approach to solve this.
The text was updated successfully, but these errors were encountered: