During functional testing for T358636, I ran into some interesting behavior: on SIGTERM, etcdmirror just hangs.
Why? Twisted's reactor.run by default installs signal handlers that supersede ours [0], which means that the watch loop [1] in read_write will never terminate.
The resulting behavior is presumably that systemd waits 90s and then issues SIGKILL, which is non-ideal (e.g., could in theory land while we're part of the way through mirroring an event).
For T358636, I'm going to need to restart etcdmirror at least once (possibly a couple of times), and it would be nice to fix this before then.
Is there a simple fix? This should be as simple as setting installSignalHandlers=False when calling run (verified by local testing), which ensures that etcdmirror exits in the next 60s (watch timeout).