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(@apollo/gateway) Call unref on the federated gateway's setInterval. #3105

Merged
merged 2 commits into from
Jul 30, 2019

Commits on Jul 29, 2019

  1. fix(@apollo/gateway) Call unref on the federated gateway's `setInte…

    …rval`.
    
    When the Apollo Gateway is configured in so-called "managed mode", it uses a
    `setInterval` timer to periodically check for updates from the Apollo Graph
    Manager (also known as Apollo Engine).
    
    However, since the Timer's `unref` method wasn't invoked, the timer would
    continue to place tasks on the event loop, even when the server had been
    requested to be shutdown.  By calling `unref`, Node.js switches the timer to
    an internal timer which doesn't block the event-loop.
    
    While we could alternatively use a `process.on` event to detect when a
    shutdown signal had been received and invoke the Gateway's `stop` method
    accordingly, this should be sufficient for this particular implementation.
    (As opposed to the implementation in `apollo-engine-reporting`  which does
    exactly this since it needs to ensure that all queued traces are transmitted
    to the cloud prior to process exit.
    abernix committed Jul 29, 2019
    Configuration menu
    Copy the full SHA
    93618f6 View commit details
    Browse the repository at this point in the history
  2. Add CHANGELOG.md for #3105.

    abernix committed Jul 29, 2019
    Configuration menu
    Copy the full SHA
    5934d42 View commit details
    Browse the repository at this point in the history