Skip to content

Conversation

@DerGuteMoritz
Copy link
Collaborator

@DerGuteMoritz DerGuteMoritz commented Sep 16, 2025

Fixes #766

See individual commits for details.

@DerGuteMoritz DerGuteMoritz marked this pull request as draft September 16, 2025 15:39
@DerGuteMoritz DerGuteMoritz changed the title Draft: Make wrap-exceptions middleware robust against nil response body Don't leak unconsumed deferreds in error state in HTTP client Sep 18, 2025
Fixes various error deferred leaks originating in Manifold itself.
To that end, turn `wrap-exceptions` from a wrapping middleware into an "after handler" (like
`handle-redirects`) called `handle-error-status`.

This also happens to improve a suboptimal behavior: When a request with `:throw-exceptions? true`
was made and an error response was received which the middleware would turn into an exception, the
underlying connection would be closed regardless of whether the response indicated keep-alive or not.
Turns out the custom pool wasn't actually used!
We breached the default of 10 minutes a few times now
@DerGuteMoritz DerGuteMoritz force-pushed the fix-766 branch 4 times, most recently from 1c5fc46 to c87dd2e Compare January 5, 2026 09:45
Enabling both Netty's resource leak detection and Manifold's dropped error deferred detection at the
same time makes the test suite so slow that we breach CircleCI's timeout of 60 minutes.
Turns out CircleCI's 60 minutes timeout applies to the overall job, not just per step. Thus, split
the test runs up into separate jobs so that they both get 60 minutes. This has the additional
advantage that they will run in parallel.
@DerGuteMoritz DerGuteMoritz marked this pull request as ready for review January 5, 2026 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NPE in wrap-exceptions HTTP client middleware

2 participants