commit 6d13ade8bf4faae42e18c4e2c79dc695891d75c4
Author: Arturo Filastò <>
Date:   Thu Sep 15 19:39:17 2016 +0200

    Add note about locking logic for run() of tasks
 ooni/agent/ | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/ooni/agent/ b/ooni/agent/
index c86e3b6..e8fef53 100644
--- a/ooni/agent/
+++ b/ooni/agent/
@@ -398,6 +398,15 @@ class SchedulerService(service.MultiService):
         This function is called every self.interval seconds to check
         which periodic tasks should be run.
+        Note: the task will wait on the lock if there is already a task of
+        that type running. This means that if a task is very long running
+        there can potentially be a pretty large backlog of accumulated
+        periodic tasks waiting to know if they should run.
+        XXX
+        We may want to do something like not wait on the lock if there is
+        already a queue that is larger than a certain amount or something
+        smarter if still starts to become a memory usage concern.
         for task in self._scheduled_tasks:
             log.debug("Running task {0}".format(task.identifier))

tor-commits mailing list

Reply via email to