[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



commit b1dcfe4a448dfe515e82d1ccdc4ea719b1551cab
Author: juga0 <juga@xxxxxxxxxx>
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 '''



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits