Repository navigation
Count DATA frame padding toward HTTP/2 flow control - #9786
Amir-Golmoradi wants to merge 7 commits into
Conversation
|
LLM text is forbidden. This is your only warning. |
|
Hi @JakeWharton, hope you have great day so far. I must say that i only used an LLM to draft the PR description and write a comment on the issue. That was wrong, and I'm sorry but because of the project that i was working on i wanted to "everything be perfect" to respect maintainer's time. i'd never wanted to disrespect the project's rules. I've written the code and tests myself, and I can explain change. Would you be open to a new PR with a description I write myself? If you'd rather I didn't submit one, I understand. |
|
I will reopen, and you can edit this one down to normal. Thanks. |
|
Hi @JakeWharton , hope you're doing well. Sorry for the late reply. I was reworking the PR description to match the project's guidelines, and it's now updated. Could you please take another look? |
| } | ||
|
|
||
| @ParameterizedTest | ||
| @ValueSource(ints = [0, 39, 255]) |
|
@Amir-Golmoradi PR is approved. You can merge this |
|
I didn’t know that; I thought one of the maintainers had to do it, since two of the workflows still need approval from the maintainers. |
|
@Amir-Golmoradi some checks are failing. Can you check please? |
|
@dimitris-selal |
|
The remaining I couldn't reproduce the timeout or establish its cause. Could you rerun |
|
@yschimke thanks for the approval. I can't merge this myself (no write access), Latest CI run:
Let me know if you want me to change anything. |
Fixes #9772.
Http2Reader.readDataskips DATA padding without telling anyone, so the Pad Length byte and padding bytes are never counted for flow control. RFC 9113 section 6.1 says the whole payload counts against the window. The peer subtracts those bytes from its send window as it transmits them, but we never send aWINDOW_UPDATEfor them, so the peer's view of the window keeps running down until it thinks there's no room left and stops sending.I added
Handler.dataPadding(streamId, length), called after the padding is skipped (Pad Length byte included). It only fires whenlength > dataLength, so unpadded frames are unchanged.In
ReaderRunnableit goes toupdateConnectionFlowControland, if the stream still exists, to a newFramingSource.receivePadding, which bumpsreadBytesright away since the app will never read those bytes. Unknown and removed streams get connection credit for the padding. Pushed streams get connection credit only, since there's noHttp2Streamyet.The reported stall is connection-level, but the same bytes come out of both windows, so I did both. Happy to split it if you prefer.
Tests cover padding of 0, 39 and 255, truncated padding, padding-only frames, and the unknown, removed and pushed-stream paths.
MockHttp2Peernow sends padded frames withsendPaddedData, sinceHttp2Writercan't.The HTTP/2 tests and
spotlessCheckpass.