Well, it's technically handled by the fact that the ephemeral node was created via the connection and when the Container goes down (gracefully), that connection is also closed.