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 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.