Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-3116

InterruptableAsyncInterval can be starved of execution

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.2.0
    • Affects Version/s: 4.0.0, 3.6.4
    • Component/s: None
    • 2
    • Not Needed

      The first clause in the wake function will prevent the task from being run with the intention being to prevent extremely frequent repeated calls. Since lastWakeTime is updated on every call to wake then the gap between lastWakeTime and currentTime might never grow.

      const currentTime = clock();
      const timeSinceLastWake = currentTime - lastWakeTime;
      lastWakeTime = currentTime;
      
      if (timeSinceLastWake < minInterval) {
        return;
      }
      

            Assignee:
            durran.jordan@mongodb.com Durran Jordan
            Reporter:
            neal.beeken@mongodb.com Neal Beeken
            Daria Pardue
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: