Open DerGuteMoritz opened 1 year ago
I think if there's no user-supplied raw error handler, we should supply a default in raw-ring-handler
. That default error handler could then close the stream, ms/consume
all the ByteBufs and .release()
them, as well as send a 503.
Hmmmm. We could also wrap a user-supplied error-handler with one which checks the refcnt and releases only if > 0. Theoretically this would be safe and helpful to users... But could there be a race if the user releases it, the ByteBuf goes back to the pool, and some non-netty thread grabs it? Maybe not.
I think you two know this area better than I, so I defer to your judgment.
Problem
Given an HTTP server started with
:raw-stream? true
, whenaleph.http.server/handle-request
hits theRejectedExecutionException
path, the default handler (i.e. when no customrejected-handler
was provided) will leak any byte buffers which are already present in the request's:body
stream.Possible solutions
rejected-handler
when:raw-stream? true
is passed