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

apollo-server: close connections on ApolloServer.stop() #4908

Merged
merged 2 commits into from
Feb 9, 2021

Commits on Feb 8, 2021

  1. apollo-server: close connections on ApolloServer.stop()

    Previously, `ApolloServer.stop()` functioned like `net.Server.close()` in that
    it did not close idle connections or close active connections after a grace
    period. This meant that trying to `await ApolloServer.stop()` could hang
    indefinitely if there are open connections. Now, this method closes idle
    connections, and closes active connections after 10 seconds. The grace period
    can be adjusted by passing the new `stopGracePeriodMillis` option to `new
    ApolloServer`, or disabled by passing `Infinity` (though it will still close
    idle connections).
    
    The feature is implemented with the `stoppable` package. I audited a few similar
    packages including `http-terminator` but stoppable seemed to be the simplest and
    most widely used.
    
    Note that this only applies to the "batteries-included" `ApolloServer` in the
    `apollo-server` package with its own built-in Express and HTTP servers.
    
    Fixes #4097.
    glasser committed Feb 8, 2021
    Configuration menu
    Copy the full SHA
    a910375 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    dbb586f View commit details
    Browse the repository at this point in the history