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

Fix issues with next tick never running #549

Merged
merged 2 commits into from
May 7, 2017

Commits on May 5, 2017

  1. Use Nan::MakeCallback to avoid random hangs

    Calling v8::Function::Call directly for async callbacks leads to very
    odd behavior in some circumstances, specifically the next tick of the
    event loop seems to get stuck. After much digging, I found references to
    this being a "known" issue, and the proper way to call async functions
    in JS is to use the node::MakeCallback helper, or the Nan equivalent. In
    some cases, we also use the Nan::Callback object as a helper for
    managing JS callbacks.
    
    KNOWN ISSUES: On node <v6, it seems that exceptions thrown from JS when
    called from .NET do NOT propagate back to .NET correctly. Instead, they
    terminate the JS process. This appears to be a known limitation of using
    the MakeCallback method, with no easy workarounds. On 6.4.0, this test
    does pass, which indicates the issue has been fixed in node.
    dpolivy committed May 5, 2017
    Configuration menu
    Copy the full SHA
    7bb0883 View commit details
    Browse the repository at this point in the history
  2. Explicitly kick the next tick instead of Nan::MakeCallback

    The previous fixes to use Nan::MakeCallback had the side effect of
    swallowing exceptions on Node <v6, which was a regression. To retain
    that behavior, we revert the JS execution calls to using Nan::Call
    instead of Nan::MakeCallback, and instead explicitly kick the next tick
    with a no-op function.
    dpolivy committed May 5, 2017
    Configuration menu
    Copy the full SHA
    83d9507 View commit details
    Browse the repository at this point in the history