The bootstrap is interrupted without any errors if the process becomes ready when already bootstrapping
At least form last year when we switched to 102 (and Clang for almost everything!), I've seen the bootstrap on Windows fail without a real cause.
I don't know if I've never thought to check the logs before a week ago, but now I did and they contain this when it happens:
2023-07-24 09:16:26.175 [NOTICE] New control connection opened from 127.0.0.1. 2023-07-24 09:16:26.189 [NOTICE] Bootstrapped 10% (conn_done): Connected to a relay 2023-07-24 09:16:26.218 [NOTICE] Closing no-longer-configured Socks listener on 127.0.0.1:9150 2023-07-24 09:16:26.218 [NOTICE] DisableNetwork is set. Tor will not make or accept non-control network connections. Shutting down all existing connections. 2023-07-24 09:16:26.219 [WARN] connection_connect_sockaddr: Bug: Tried to open a socket with DisableNetwork set. (on Tor 0.4.8.2-alpha-dev 1b4b354f4d76bce2) 2023-07-24 09:16:26.219 [WARN] tor_bug_occurred_: Bug: connection.c:2204: connection_connect_sockaddr: This line should not have been reached. (Future instances of this warning will be silenced.) (on Tor 0.4.8.2-alpha-dev 1b4b354f4d76bce2) 2023-07-24 09:16:26.219 [WARN] Bug: Tor 0.4.8.2-alpha-dev (git-1b4b354f4d76bce2): Line unexpectedly reached at connection_connect_sockaddr at connection.c:2204. (Stack trace not available) (on Tor 0.4.8.2-alpha-dev 1b4b354f4d76bce2) 2023-07-24 09:16:26.224 [NOTICE] DisableNetwork is set. Tor will not make or accept non-control network connections. Shutting down all existing connections. 2023-07-24 09:16:27.125 [NOTICE] Delaying directory fetches: DisableNetwork is set. 2023-07-24 09:16:30.315 [NOTICE] New control connection opened from 127.0.0.1.
I was about to open an issue on little-t-tor, but I think we can investigate a little bit more on our end, first.
At least so that we can give the netteam more context for this.
In particular, I think we should find if we're calling DisableNetwork and why.
It might be that we're misinterpreting a bootstrap notification, and move back in the
TorConnect state machine (or, maybe, we're going back to the
Configure state for any other reason).
I don't do anything special to make this appear, but it happens quite randomly (not always), and I think it's quite easy to encounter it.