Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(@apollo/gateway) Call
unref
on the federated gateway's `s… (#3105)
* fix(@apollo/gateway) Call `unref` on the federated gateway's `setInterval`. 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. * Add CHANGELOG.md for #3105.
- Loading branch information