GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |
GeezerVison is showing github.com — Auto-port 4.1: Release unsent LastHttpContent in HttpChunkedInput by netty-project-bot · Pull Request #17251 · netty/netty Conversation
Contributor
Auto-port of #17240 to 4.1 Motivation:
Modification:
Result: Custom terminating content is released when a chunked HTTP write is closed Testing:
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsMotivation: `HttpChunkedInput` retains a custom `LastHttpContent` until `readChunk(...)` returns it. If `ChunkedWriteHandler` discards a suspended or otherwise incomplete write, it closes the `HttpChunkedInput`, but the previous implementation only closed the wrapped input. The unsent terminating content therefore remained at `refCnt == 1`. Modification: - Release the terminating content from `HttpChunkedInput.close()` when it has not been handed off by `readChunk(...)`. - Perform that release in a `finally` block so a wrapped input close failure cannot leak the content. - Mark the terminal state before releasing so repeated `close()` calls cannot double-release it. - Document ownership of a custom terminating content. - Add tests for an aborted `ChunkedWriteHandler` write, the successful handoff path, a wrapped input close failure, and repeated close calls. Result: Custom terminating content is released when a chunked HTTP write is closed before completion, while successfully handed-off content remains owned by the outbound pipeline. Testing: - `./mvnw -q -pl codec-http -Dtest=HttpChunkedInputTest test` - `./mvnw -q -Pleak -pl codec-http -Dtest=HttpChunkedInputTest test` - `./mvnw -q -pl codec-http -am -DskipTests install` (cherry picked from commit 93602ab)
|
There was an error while loading. Please reload this page.
✅ All tests passed ✅🏷️ Commit: dc54ade Learn more about TestLens at testlens.app. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
…tty#17251) Auto-port of netty#17240 to 4.1 Cherry-picked commit: 93602ab --- Motivation: `HttpChunkedInput` retains a custom `LastHttpContent` until `readChunk(...)` returns it. If `ChunkedWriteHandler` discards a suspended or otherwise incomplete write, it closes the `HttpChunkedInput`, but the previous implementation only closed the wrapped input. The unsent terminating content therefore remained at `refCnt == 1`. Modification: - Release the terminating content from `HttpChunkedInput.close()` when it has not been handed off by `readChunk(...)`. - Perform that release in a `finally` block so a wrapped input close failure cannot leak the content. - Mark the terminal state before releasing so repeated `close()` calls cannot double-release it. - Document ownership of a custom terminating content. - Add tests for an aborted `ChunkedWriteHandler` write, the successful handoff path, a wrapped input close failure, and repeated close calls. Result: Custom terminating content is released when a chunked HTTP write is closed before completion, while successfully handed-off content remains owned by the outbound pipeline. Testing: - `./mvnw -q -pl codec-http -Dtest=HttpChunkedInputTest test` - `./mvnw -q -Pleak -pl codec-http -Dtest=HttpChunkedInputTest test` - `./mvnw -q -pl codec-http -am -DskipTests install` --------- Co-authored-by: Gimin Kim <[email protected]> Co-authored-by: Norman Maurer <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.