[tor-commits] [ooni-probe/master] Implement workaround a race condition that happens when calling next on generator.

art at torproject.org art at torproject.org
Sat Jan 4 16:56:27 UTC 2014


commit 8058d81e0dc5307808fd300267e17b5997d1e1dd
Author: Arturo Filastò <art at fuffa.org>
Date:   Fri Jan 3 20:03:00 2014 +0100

    Implement workaround a race condition that happens when calling next on generator.
---
 ooni/managers.py |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/ooni/managers.py b/ooni/managers.py
index 348343f..f6af282 100644
--- a/ooni/managers.py
+++ b/ooni/managers.py
@@ -58,6 +58,11 @@ class TaskManager(object):
                 self._run(task)
             except StopIteration:
                 break
+            except ValueError as exc:
+                # XXX this is a workaround the race condition that leads the
+                # _tasks generator to throw the exception
+                # ValueError: generator already called.
+                continue
 
     def _run(self, task):
         """





More information about the tor-commits mailing list