3b8cdd3 Avoid deep recursion when handling a large queue of events

Authored and Committed by otaylor 2 years ago
    Avoid deep recursion when handling a large queue of events
    
    Because each event handler wrapper would call scheduler.run() at the end before
    returning, with a queue of 100 events to process we'd end up
    with:
    
     Event handler 1 wrapper
       scheduler.run()
         Event handler 2 wrapper
           scheduler.run()
             .....
                .... Event handler 100 wrapper
    
    Which would eventually exhaust the Python stack limit. Fix this by making scheduler.run()
    no-op if the scheduler is already processing the queue in the current thread.
    
        
  • jenkins
    failure
    Build #1877 failed (commit: 3b8cdd34)
    2 years ago