Repository navigation
Fastify native close, server framework matrix - #61
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@cancjs/server-fastifynow finishes its shutdown inside fastify's ownapp.close(). A plainawait app.close()lets in-flight requests finish withConnection: closeand cancels the ones still running atcancelAfter, instead of resetting them or waiting on idle kept-alive connections.createShutdown(app, options)stores the options that close uses, and itsshutdown()runsapp.close(). Fastify cuts the close off atpluginTimeout(10 s by default), so inside fastify's close the windows are lowered to end just under it andapp.log.warnreports that once; anInfinitywindow is lowered too, andpluginTimeout: 0keeps it.The server adapters are now tested against their oldest and newest supported framework versions. A framework parity spec runs the same cancel, deadline and shutdown cases through express, fastify, hono, koa and node, and a CI job
server-framework-matrixruns the server suites at the floor versions and at the latest.@cancjs/server-honoraises its peer floors tohono >=4.8.0and@hono/node-server >=1.9.0, the oldest releases it is tested against. It stops@hono/node-server2 from loggingERR_HTTP_HEADERS_SENTfor a response cut after its head was sent, andcancelErrorHandler()logs an error the request does not own the way Hono does, with the bare error passed toconsole.error.Testing
npm run build,npm run surface:check,npm run surface:removals,npm run check:brand-keysandnpm pack --dry-runfor the five server packages pass on a fresh build.server-framework-matrixat the floor and at the latest.Breaking changes
@cancjs/server-fastify: a request that arrives on a kept-alive connection during the shutdown is answered by fastify, with 503 unlessreturn503OnClosingis false, instead of being served. Setreturn503OnClosing: falseto keep serving such requests.@cancjs/server-hono: peershono 4.0to4.7and@hono/node-server 1.0to1.8are no longer supported; those users get a peer conflict and must upgrade.