grpc: implement BufferedAsyncClient for bidirectional gRPC stream#18129
grpc: implement BufferedAsyncClient for bidirectional gRPC stream#18129lizan merged 15 commits intoenvoyproxy:mainfrom
Conversation
Signed-off-by: Shikugawa <[email protected]>
|
/assign-from @envoyproxy/envoy-maintainers |
|
@envoyproxy/envoy-maintainers assignee is @dio |
Signed-off-by: Shikugawa <[email protected]>
Signed-off-by: Shikugawa <[email protected]>
mathetake
left a comment
There was a problem hiding this comment.
Overall I would like to see the doc comment on the class.
Signed-off-by: Shikugawa <[email protected]>
…red-grpc-client Signed-off-by: Shikugawa <[email protected]>
Signed-off-by: Shikugawa <[email protected]>
Signed-off-by: Shikugawa <[email protected]>
|
@lizan Fixed not to expose |
|
ping @lizan PTAL |
Signed-off-by: Shikugawa <[email protected]>
…red-grpc-client Signed-off-by: Shikugawa <[email protected]>
Signed-off-by: Shikugawa <[email protected]>
|
/retest |
|
Retrying Azure Pipelines: |
|
/retest |
|
Retrying Azure Pipelines: |
|
/retest |
|
Retrying Azure Pipelines: |
Signed-off-by: Shikugawa <[email protected]>
|
Retrying Azure Pipelines: |
|
/retest |
|
Retrying Azure Pipelines: |
Signed-off-by: Shikugawa <[email protected]>
|
@lizan friendly ping |
|
/assign-from @envoyproxy/envoy-maintainers for non-tetrands review |
|
@envoyproxy/envoy-maintainers assignee is @zuercher |
zuercher
left a comment
There was a problem hiding this comment.
Just some questions about the API for the template. Let me know what you think.
| } | ||
|
|
||
| auto id = publishId(); | ||
| message_buffer_[id] = std::make_pair(BufferState::Buffered, message); |
There was a problem hiding this comment.
In #17486 this id is set on the RequestType (CriticalAccessLogsMessage). In conjunction with the previous comment, maybe we should return absl::optional<uint64_t> with the id if buffered or null_opt if the buffer's full? The caller can then add the id to the message (although that kind of change via the message reference feels a little weird). Another possibility is to require that the id is passed obtained via publishId, used to call set_id on the message, and then passed to bufferMessage as a separate parameter.
There was a problem hiding this comment.
I missed it. I agree with to return absl::optional<uint64_t> them the caller set it to the message.
Signed-off-by: Shikugawa <[email protected]>
Signed-off-by: Shikugawa <[email protected]>
zuercher
left a comment
There was a problem hiding this comment.
Thanks. I had some final comments, but otherwise looks good.
| auto& message = it.second.second; | ||
|
|
||
| if (state == BufferState::PendingFlush) { | ||
| continue; |
There was a problem hiding this comment.
I think we should add a test that covers this case, since it prevents double sending. I noticed it's not hit in the coverage report
| } | ||
| } | ||
|
|
||
| absl::optional<uint64_t> bufferMessage(RequestType& message) { |
There was a problem hiding this comment.
nit: Consider adding a comment that indicates that null_opt means buffer full.
Signed-off-by: Shikugawa <[email protected]>
|
@lizan Ready to merge |
* main: (71 commits) bazel: fix macOS build (envoyproxy#18920) http: switching from 100 to 1xx (envoyproxy#18904) grpc: implement BufferedAsyncClient for bidirectional gRPC stream (envoyproxy#18129) bazel: add repository arg to benchmark_test (envoyproxy#18795) rocketmq_proxy: Improvement for map find (envoyproxy#18909) tls: unit test: spiffe signed by intermediate cert (envoyproxy#18914) Test for FilterConfigPerRoute dtor called on worker thread. (envoyproxy#18927) deps: Bump `com_google_protobuf` -> 3.19.1 (envoyproxy#18930) deps: Bump `com_googlesource_code_re2` -> 2021-11-01 (envoyproxy#18933) cvescan: Move cvescan data to yaml (envoyproxy#18947) remove unnecessary file level not unimplemented hide annotation (envoyproxy#18924) test: moving echo test (envoyproxy#18938) test: fixing a test flake (envoyproxy#18899) deps: Revert pyparsing bump (envoyproxy#18946) deps: Bump `build_bazel_rules_apple` -> 0.32.0 (envoyproxy#18932) deps: Bump `com_github_bazelbuild_buildtools` -> 4.2.3 (envoyproxy#18931) build(deps): bump pycparser from 2.20 to 2.21 in /tools/dependency (envoyproxy#18936) quic: supporting connections with zero initial available streams (envoyproxy#18775) test: moving proxy proto (envoyproxy#18939) build(deps): bump pyparsing from 3.0.4 to 3.0.5 in /tools/dependency (envoyproxy#18937) ... Signed-off-by: Michael Puncel <[email protected]>
Signed-off-by: Shikugawa [email protected]
Commit Message: grpc: implement BufferedAsyncClient for bidirectional gRPC stream
Additional Description: This function is a component for buffering and tracking the state of messages sent in the gRPC bidirectional stream. This component makes it possible to monitor and control the transmission status of highly granular messages from the Envoy side, and is identical to the one implemented in #17486.
Risk Level: Low
Testing: Unit
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Deprecated:]
[Optional API Considerations:]
cc @snowp @lizan