feat: First-class support for handler-level timeouts#6521
Merged
Conversation
Member
Author
|
@metcoder95 @mcollina @gurgunday Any thoughts on this one? |
mcollina
reviewed
Feb 25, 2026
Member
mcollina
left a comment
There was a problem hiding this comment.
This is a good substantial feature, thanks!
jsumners
reviewed
Feb 25, 2026
mcollina
reviewed
Feb 25, 2026
Fdawgs
added a commit
that referenced
this pull request
Mar 1, 2026
Missed in #6521 Signed-off-by: Frazer Smith <frazer.dev@icloud.com>
2 tasks
Fdawgs
added a commit
that referenced
this pull request
Mar 1, 2026
* docs(reference/hooks): fix note stlye Missed in #6521 Signed-off-by: Frazer Smith <frazer.dev@icloud.com> * Update docs/Reference/Hooks.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Frazer Smith <frazer.dev@icloud.com> --------- Signed-off-by: Frazer Smith <frazer.dev@icloud.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Adds a first-class handlerTimeout option, configurable per-server and per-route, backed by an AbortSignal exposed as request.signal. Unlike the existing socket-level timeouts (connectionTimeout, requestTimeout), this is an application-level timeout that works correctly with HTTP keep-alive and can be scoped to individual routes, and used together with flows that support AbortSignal (fetch, DBs etc).
Highlights
created, only a single branch check per request
value;
Handlers use request.signal to propagate cancellation to downstream I/O;
(FST_ERR_HANDLER_TIMEOUT vs generic AbortError);
reply.hijack(), timeout, and client disconnect;
status/body customization;
FST_ERR_MISSING_HANDLER_TIMEOUT.
Checklist
npm run test && npm run benchmark --if-presentand the Code of conduct