You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enhancement Description
ContentSourceByteBuffer, ContentSourceString, ChunkAccumulator, ContentSourceConsumer implementations use provided Promise and call promise.failed/succeeded, but don't take into the account that user defined callback may fail and chunk/source won't be released/failed in such case.
if (Content.Chunk.isFailure(chunk))
{
promise.failed(chunk.getFailure()); // throw exceptionif (!chunk.isLast())
source.fail(chunk.getFailure());
return;
}
// some action that throws exceptionchunk.release();
The good reference implementation from my point of view is ContentCopier, that's for succeeded and failed events always release resources
The text was updated successfully, but these errors were encountered:
@gregw I had reviewed that issue briefly, but as far as I understood the main goal to simplify and unify RBB public API. But current issue is intended to show that there are multiple implementations that do the same "chunk iterating loop"(start-demand-read-process chunk-repeat) and have the same issue about potential resource leaks.
This issue relates to the #11758. The suggestion was to use the same "ChunkIterator" for all "asXXX"(asString/asByteArray and so on) functions. ChunkIterator could be current Flow.Publisher implementation for example. To show the basic idea:
Jetty version(s)
12.0.8
Enhancement Description
ContentSourceByteBuffer, ContentSourceString, ChunkAccumulator, ContentSourceConsumer implementations use provided Promise and call promise.failed/succeeded, but don't take into the account that user defined callback may fail and chunk/source won't be released/failed in such case.
The good reference implementation from my point of view is ContentCopier, that's for succeeded and failed events always release resources
The text was updated successfully, but these errors were encountered: