You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Tortoise.Registry looks like it is not monitoring new Connection processes, so if they fail (or are simply closed) the information is still retained in the registry. This happens regardless of using start_link to create the connection or if you use the Tortoise.Supervisor to create the connection and close it with DynamicSupervisor.terminate_child(Tortoise.Supervisor, connection_pid). If the client_id remains the same, a new connection will not create a new entry, but in our use case we make many transient connections over time, and each has a unique client_id. So the failure to remove unused entries causes a long-term memory leak essentially.
Is there a way to remove unused entries in the Tortoise.Registry? It might be preferable to have the registry monitor the connections and remove any entries automagically, as other registries do.
The text was updated successfully, but these errors were encountered:
I have found something of a work-around for this issue. If I create something of a supervisory process, which uses start_link to create the Tortoise.Connection.start_link, and this process is trapping exits, I can call the following to clean up the Tortoise.Registry entries when the connection fails or the supervising process closes in it's terminate function:
The Tortoise.Registry looks like it is not monitoring new Connection processes, so if they fail (or are simply closed) the information is still retained in the registry. This happens regardless of using start_link to create the connection or if you use the Tortoise.Supervisor to create the connection and close it with DynamicSupervisor.terminate_child(Tortoise.Supervisor, connection_pid). If the client_id remains the same, a new connection will not create a new entry, but in our use case we make many transient connections over time, and each has a unique client_id. So the failure to remove unused entries causes a long-term memory leak essentially.
Is there a way to remove unused entries in the Tortoise.Registry? It might be preferable to have the registry monitor the connections and remove any entries automagically, as other registries do.
The text was updated successfully, but these errors were encountered: