TCA freezes while tor is stopped
TCA interacts a lot with tor
, but does that through onion-grater
.
Unfortunately, as of stem 1.7.1
, most operations have no way to set a timeout. So if TCA
tries, for example, to SETCONF
while tor
is stopped, it will just hang until tor
is started again. This happened during test suite at least once.
At first thought, it should never happen that tor
is stopped for a long time. So if it happens, there's another bug going on. This explains why the bug has low priority.
Things we could do to alleviate the bug:
- understand the conditions that lead to
tor
being killed! - upgrade
python3-stem
to 1.8.0 (available in backports and in bullseye), which will bring atimeout
argument torecv()
method, which should allow us to avoid blocking forever - subcribe to events instead of polling. This is generally better design and will avoid blocking during the progress step. The problem will however show up when TCA needs to
getconf
, so that doesn't really fix it - set a timeout at the onion-grater level. If a message doesn't get a response,
onion-grater
itself could respond with an error message