Drop for TorClient flushes state too frequently.
Try making a connection through arti as a proxy. Every time you do so, you'll see:
2022-02-03T18:49:51.418608Z INFO arti_client::client: Flushed persistent state at exit.
This is happening because of how we've refactored our code. Long ago, we handed out Arc instances, and dropping a TorClient instance only happened when we were closing it completely. But now that we have isolated_client
and clone_with_prefs
, we're using TorClient
as handle object, and dropping them all the time.
We should change the code so that we only trigger this kind of flush for the persistent state when the last shared part of the TorClient is getting dropped.
Edited by Nick Mathewson