museumsvictoria/nodel

Toolkit timers can be coded to be left orphaned

justparking opened this issue · 0 comments

A particular coding pattern and a race condition caused during periods of high activity could result in timers being orphaned and not cleaned up during node restarts.

Example code:

@local_action({})
def go():
  keepTrying()
  
def keepTrying():
  try:
    console.info('trying...')
    
  except:
    console.warn('failed! will backoff for 10s')
    call(keepTrying, 10.0)
    
  finally:
    console.info('will keep trying in 2s')
    call(keepTrying, 2.0)