Repository navigation
Conversation
https://bz.apache.org/bugzilla/show_bug.cgi?id=69617 The existing note says that maxHttpRequestHeaderSize is allocated in full for every request, but not that the allocation outlives the requests that caused it. Http11InputBuffer.recycle() only resets the position and limit of the ByteBuffer, and the processor is then pushed back onto the connection handler's recycled processor stack, so each cached processor keeps its header buffer for as long as it sits in that cache.
Contributor
|
I applied an alternative update. Dropping the processorCache has significant performance implications. If the docs suggest that, the docs also need to cover the implications. I think drawing attention to the processorCache shoudl be sufficient. |
Contributor
Author
|
Thanks — your version covers what I was after. |
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.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69617
The
maxHttpRequestHeaderSizedocumentation already warns that the full amountis allocated for every request, but not that the allocation outlives the
requests that caused it.
Http11InputBuffer.recycle()leaves theByteBufferin place and only resets its position and limit, so it survives
Http11Processor.recycle()and stays reachable for as long as the processorsits in the connection handler's recycled processor stack, which is bounded by
processorCache(200 by default). On a keep-alive connection the processorgoes back to that stack between requests as well.
Http11OutputBufferallocatesmaxHttpResponseHeaderSizein its constructorand retains it the same way, and
maxHttpHeaderSizeprovides the default forboth. I kept this change to the attribute the bug is about; happy to add a
matching note under
maxHttpResponseHeaderSizeif you prefer.