sometimg a rpc call to nitrate gets stuck and there's (AFAIK) no way how to handle this cleanly. Would it be possible to implement e.g. a built-in timeout to the update function or some way of resetting & recycling a stuck connection?
Yes, that should be relatively easy to implement. We just have to figure out what would the best place where to handle the timeouts, especially with the fresh support for multicall (still needs some polishing). Pasting Brano's implementation brainstorming for future reference: #!/usr/bin/python import sys import signal import nitrate class TimeoutException(Exception): pass def get_it(timeout): def timeout_handler(signum, frame): raise TimeoutException() old_handler = signal.signal(signal.SIGALRM, timeout_handler) signal.alarm(timeout) tc = nitrate.TestCase(76191) tc.notes = "jdfgdfglfdjgkldfjgldfjglfdjgldfjgljdfgbndjfbnvdfvfdvfdv" try: tc.update() return True except TimeoutException: return False finally: signal.signal(signal.SIGALRM, old_handler) signal.alarm(0) return name if __name__ == '__main__': try: print str(get_it(1)) except TimeoutException: print "Timeout." try: print str(get_it(5)) except TimeoutException: print "Timeout."