[tor-commits] [sbws/master] Stop giving exception when threads can not start

pastly at torproject.org pastly at torproject.org
Tue Jun 26 15:36:49 UTC 2018


commit b1dcfe4a448dfe515e82d1ccdc4ea719b1551cab
Author: juga0 <juga at riseup.net>
Date:   Mon Jun 18 11:12:45 2018 +0000

    Stop giving exception when threads can not start
    
    instead log the error and exit.
    Fixes #195
---
 sbws/lib/resultdump.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/sbws/lib/resultdump.py b/sbws/lib/resultdump.py
index 32fd1cd..977a9e5 100644
--- a/sbws/lib/resultdump.py
+++ b/sbws/lib/resultdump.py
@@ -11,7 +11,7 @@ from queue import Empty
 from datetime import datetime
 from datetime import timedelta
 from enum import Enum
-from sbws.globals import RESULT_VERSION
+from sbws.globals import RESULT_VERSION, fail_hard
 from sbws.util.filelock import DirectoryLock
 from sbws.lib.relaylist import Relay
 
@@ -444,7 +444,10 @@ class ResultDump:
         self.data_lock = RLock()
         self.thread = Thread(target=self.enter)
         self.queue = Queue()
-        self.thread.start()
+        try:
+            self.thread.start()
+        except RuntimeError as e:
+            fail_hard(e)
 
     def store_result(self, result):
         ''' Call from ResultDump thread '''





More information about the tor-commits mailing list