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

[8.x] Backport 18513, 18694 #19517

Merged
merged 3 commits into from
Jun 28, 2018
Merged

Commits on Jun 28, 2018

  1. async_hooks: deprecate unsafe emit{Before,After}

    The emit{Before,After} APIs in AsyncResource are problematic.
    
    * emit{Before,After} are named to suggest that the only thing they do
      is emit the before and after hooks. However, they in fact, mutate
      the current execution context.
    * They must be properly nested. Failure to do so by user code leads
      to catastrophic (unrecoverable) exceptions. It is very easy for the
      users to forget that they must be using a try/finally block around
      the code that must be surrounded by these operations. Even the
      example provided in the official docs makes this mistake. Failing
      to use a finally can lead to a catastrophic crash if the callback
      ends up throwing.
    
    This change provides a safer `runInAsyncScope` API as an alternative
    and deprecates emit{Before,After}.
    
    Backport-PR-URL: nodejs#19517
    PR-URL: nodejs#18513
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Anna Henningsen <[email protected]>
    Reviewed-By: Andreas Madsen <[email protected]>
    ofrobots committed Jun 28, 2018
    Configuration menu
    Copy the full SHA
    e2b3807 View commit details
    Browse the repository at this point in the history
  2. lib: provide proper deprecation code

    Refs: nodejs#18513
    
    Backport-PR-URL: nodejs#19517
    PR-URL: nodejs#18694
    Refs: nodejs#18513
    Reviewed-By: Ali Ijaz Sheikh <[email protected]>
    Reviewed-By: Colin Ihrig <[email protected]>
    Reviewed-By: Jeremiah Senkpiel <[email protected]>
    Reviewed-By: Luigi Pinca <[email protected]>
    BridgeAR authored and ofrobots committed Jun 28, 2018
    Configuration menu
    Copy the full SHA
    9065e08 View commit details
    Browse the repository at this point in the history
  3. async_hooks: remove runtime deprecation

    As part of the backport to 8.x, this change removes the runtime
    deprecation making this a docs-only deprecation for 8.x.
    
    PR-URL: nodejs#19517
    Reviewed-By: mcollina - Matteo Collina <[email protected]>
    ofrobots committed Jun 28, 2018
    Configuration menu
    Copy the full SHA
    6696271 View commit details
    Browse the repository at this point in the history