Commit 33fd0e3a authored by Jeremy Hylton's avatar Jeremy Hylton

In close_server(), fix reference to timeouts.

Close the trigger when the server exits.
parent 4f979d02
...@@ -235,7 +235,8 @@ class StorageServer: ...@@ -235,7 +235,8 @@ class StorageServer:
This is only called from the test suite, AFAICT. This is only called from the test suite, AFAICT.
""" """
self.timeout.stop() for timeout in self.timeouts.values():
timeout.stop()
self.dispatcher.close() self.dispatcher.close()
for storage in self.storages.values(): for storage in self.storages.values():
storage.close() storage.close()
...@@ -782,13 +783,17 @@ class TimeoutThread(threading.Thread): ...@@ -782,13 +783,17 @@ class TimeoutThread(threading.Thread):
self._active.wait() self._active.wait()
self._lock.acquire() self._lock.acquire()
try: try:
howlong = self._deadline - time.time() deadline = self._deadline
if deadline is None:
continue
howlong = deadline - time.time()
finally: finally:
self._lock.release() self._lock.release()
if howlong <= 0: if howlong <= 0:
self.timeout() self.timeout()
else: else:
time.sleep(howlong) time.sleep(howlong)
self.trigger.close()
def timeout(self): def timeout(self):
self._lock.acquire() self._lock.acquire()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment