zio-http icon indicating copy to clipboard operation
zio-http copied to clipboard

Netty pipeline errors cannot be observed by middleware

Open jgranstrom opened this issue 11 months ago • 5 comments

This means requests rejected by Netty, for example due to request size (default 100kb) will silently fail while responding 413, and no request logging or metric middleware will be able to observe this and likely some other failure modes.

See https://discord.com/channels/629491597070827530/819703129267372113/1217054850966229082

jgranstrom avatar Mar 12 '24 20:03 jgranstrom

This is a problem because middleware only affects requests and responses. So there's no nice way to model pipeline errors.

The ideal solution would be a "middleware tower", where the highest level can handle any handler, the lower level can handle request/response. However, I think that's probably out of scope for ZIO HTTP 3.0

jdegoes avatar Jun 05 '24 02:06 jdegoes

This is a problem because middleware only affects requests and responses. So there's no nice way to model pipeline errors.

The ideal solution would be a "middleware tower", where the highest level can handle any handler, the lower level can handle request/response. However, I think that's probably out of scope for ZIO HTTP 3.0

Sounds good to me! Any plans on adding a level like that after 3.0? It would also be quite helpful for things like capturing lower level errors in middleware I think, which is a separate but somewhat related topic. Such as capturing a stack trace in an error logging middleware.

jgranstrom avatar Jun 16 '24 13:06 jgranstrom

@jdegoes do you mean 3.0 or 3.x?

987Nabil avatar Jun 16 '24 19:06 987Nabil