Opened 6 years ago

Closed 2 years ago

#11978 closed defect (wontfix)

Recursion limit problem in TaskManager

Reported by: cypherpunks Owned by: hellais
Priority: Medium Milestone:
Component: Archived/Ooni Version:
Severity: Normal Keywords: archived-closed-2018-07-04
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


This issue was automatically migrated from github issue

The task manager is currently designed to recursively call _fillSlots that will then call _run that then again will call _fillSlots on success or failure. This means that when there are a lot of tasks failing very quickly it is very likely that the default python recursion limit will be overcome (1000).

To reproduce this bug you can try and run a test with a long invalid input for example http_requests:

ooniprobe blocking/http_requests -f data/complete.deck

Note that the fact that this test fails is correct, however it fails in a surprising manner:

Unhandled error in Deferred:
Unhandled Error
Traceback (most recent call last):

File "/ooni-probe/ooni/", line 153, in _failed

super(LinkedTaskManager, self)._failed(result, task)

File "/ooni-probe/ooni/", line 44, in _failed


File "/.virtualenvs/ooni-probe/lib/python2.7/site-packages/twisted/internet/", line 423, in errback


File "/.virtualenvs/ooni-probe/lib/python2.7/site-packages/twisted/internet/", line 490, in _startRunCallbacks


--- <exception caught here> ---

File "/.virtualenvs/ooni-probe/lib/python2.7/site-packages/twisted/internet/", line 577, in _runCallbacks

current.result = callback(current.result, *args, kw)

File "/ooni-probe/ooni/", line 188, in measurementFailed

log.msg("Failed doing measurement: %s" % measurement)

File "/ooni-probe/ooni/utils/", line 62, in msg

print "%s" % msg

File "/.virtualenvs/ooni-probe/lib/python2.7/site-packages/twisted/python/", line 505, in write

msg(message, printed=1, isError=self.isError)

File "/.virtualenvs/ooni-probe/lib/python2.7/site-packages/twisted/python/", line 53, in sync

return function(self, *args, kwargs)

File "/.virtualenvs/ooni-probe/lib/python2.7/site-packages/twisted/python/", line 185, in msg

actualEventDict = (context.get(ILogContext) or {}).copy()

File "/.virtualenvs/ooni-probe/lib/python2.7/site-packages/twisted/python/", line 121, in getContext

return self.currentContext().getContext(key, default)

exceptions.RuntimeError: maximum recursion depth exceeded

I think this bug is perhaps a good opportunity to discuss some possible refactoring of the task scheduler related code. It may be a good idea to draw some inspiration from:

Child Tickets

Change History (2)

comment:1 Changed 3 years ago by teor

Severity: Normal

Set all open tickets without a severity to "Normal"

comment:2 Changed 2 years ago by teor

Keywords: archived-closed-2018-07-04 added
Resolution: wontfix
Status: newclosed

Close all tickets in archived components

Note: See TracTickets for help on using tickets.