I have an IP address that changes roughly every 24 hours. About two out of three times, I’ve seen Tor detect that my IP address changed; but the last time it didn’t work and I had to restart the relay manually.
Is this flakiness expected or is there simply a nontrivial amount of delay before Tor detects this change? Should I write a script that restarts Tor instead of waiting for it to detect IP changes on its own?
You're correct: Tor will detect the address change unless it's instructed to use a specific IP address in the torrc config. To speed up the address detection use a python script that will use Stem library for Tor and will check if your address has changed. And - when it changed - send SIGNAL NEWNYM to Tor control port and try to make an outgoing request, it will speed up the detection greatly