python's thread model is basically a big pile of voodoo. it doesn't work consistently, as cpython itself is not thread safe.
what blocks in your code is the getattr -- conn.root or conn.root.test. this is because the bg serving thread holds the connection mutex almost exclusively. i have no real solution for that -- the lock is released by the bg thread, while the main thread waits for it, but instead of the main thread acquiring it, the bg thread acquires it again.
you can try adding sleep(0.1) in the code of BgServerThread:
def _bg_server(self):
try:
while self._active:
self._conn.serve(self.INTERVAL)
time.sleep(0.1)
except Exception:
if self._active:
raise
my tests show it helps... sorry i can't do more :-/
-tomer
An NCO and a Gentleman