Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timers: refactor setImmediate error handling #17879

Closed

Commits on Jan 2, 2018

  1. timers: refactor setImmediate error handling

    If an error is encountered during the processing of Immediates, schedule
    the remaining queue to finish after all error handling code runs (if the
    process is still alive to do so). The new changes make the Immediates
    error handling behaviour entirely deterministic and predictable, as the
    full queue will be flushed on each Immediates cycle, regardless of
    whether an error is encountered or not.
    
    Currently this processing is scheduled for nextTick which can yield
    unpredictable results as the nextTick might happen as early as close
    callbacks phase or as late as after the next event loop turns Immediates
    all fully processed. The latter can result in two full cycles of
    Immediates processing during one even loop turn.
    
    The current implementation also doesn't differentiate between Immediates
    scheduled for the current queue run or the next one, so Immediates that
    were scheduled for the next turn of the event loop, will process
    alongside the ones that were scheduled for the current turn.
    apapirovski committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    3dd5c1b View commit details
    Browse the repository at this point in the history