wasphin opened a new pull request, #3430:
URL: https://github.com/apache/brpc/pull/3430
### What problem does this PR solve?
Issue Number: #1346, #1770, #1983, #2117
Problem Summary:
The gRPC client previously attempted to serialize the entire request into
HTTP/2 DATA frames immediately.
When the request size exceeded the peer's available connection-level or
stream-level flow-control window, frame generation failed and the RPC
returned
an error instead of waiting for WINDOW_UPDATE.
The client needs to retain unsent DATA while waiting for the peer to restore
the flow-control window. This retained DATA must be bounded and released with
the RPC lifecycle to prevent excessive memory usage when the peer does not
send
WINDOW_UPDATE.
### What is changed and the side effects?
Changed:
- Split client request DATA frames according to both connection-level and
stream-level HTTP/2 flow-control windows.
- Store DATA that cannot be sent immediately in H2StreamContext.
- Resume sending pending DATA when a valid WINDOW_UPDATE restores the
available window.
- Track the total pending request DATA size for each H2 connection.
- Use socket_max_unwritten_bytes as the upper bound for pending request DATA.
- Reject new requests with EOVERCROWDED after a connection reaches the
pending DATA limit.
Side effects:
- Performance effects:
- Requests blocked by remote flow control remain buffered until the peer
sends WINDOW_UPDATE, the RPC finishes, or the stream is removed.
- Pending DATA accounting and flow-control operations use the existing H2
stream mutex.
- Fragmented requests may require additional DATA frame serialization and
socket writes.
- Breaking backward compatibility: N/A
---
### Check List:
- Please make sure your changes are compilable.
- When providing us with a new feature, it is best to add related tests.
- Please follow [Contributor Covenant Code of
Conduct](https://github.com/apache/brpc/blob/master/CODE_OF_CONDUCT.md).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]