Repository navigation
change TSI socket max frame size to 16KB - #15297
Conversation
|
Hi @yihuazhang, welcome and thank you for your contribution. We will try to review your Pull Request as quickly as possible. In the meantime, please take a look at the contribution guidelines if you have not done so already. |
|
@antoniovicente F.Y.I. |
…<[email protected]> Signed-off-by: yihuaz <[email protected]>
8d3e5b7 to
60fb222
Compare
| tsi_result status = alts_tsi_handshaker_create( | ||
| options.get(), target_name, handshaker_service.c_str(), is_upstream, | ||
| nullptr /* interested_parties */, &handshaker, 0 /* default max frame size */); | ||
| nullptr /* interested_parties */, &handshaker, 16384 /* default max frame size */); |
There was a problem hiding this comment.
Thanks for making these changes.
Would it be possible to add some basic tests to cover the behavior changes in this PR?
There was a problem hiding this comment.
It took some time figuring out how the current envoy/alts tests work. I added some tests to verify if a correct frame size (16KB) will be used by a protector. There are some tests that I want to add, which depend on the change in gRPC code base (grpc/grpc#25621). I added TODO for them, and will fix them once the PR is in and envoy updates the gRPC version.
Signed-off-by: yihuaz <[email protected]>
11f1da7 to
2a9c4d4
Compare
| tsi_zero_copy_grpc_protector* frame_protector; | ||
| grpc_core::ExecCtx exec_ctx; | ||
| status = tsi_handshaker_result_create_zero_copy_grpc_protector(handshaker_result, nullptr, | ||
| status = tsi_handshaker_result_create_zero_copy_grpc_protector(handshaker_result, &default_max_frame_size_, |
There was a problem hiding this comment.
The formatter really wants you to do a few changes, please look at:
antoniovicente
left a comment
There was a problem hiding this comment.
Change looks great, but needs a format fix.
|
@yihuazhang thanks for the fix! I had a quick look at the test and one thing I was wondering about is how much of the bug is fixed here before we do a TSI library update. Is this just changing the Envoy max frame size plumbing, but we need a TSI-side fix as well for it to be fully effective? |
Signed-off-by: yihuaz <[email protected]>
ccda647 to
b5244bb
Compare
Signed-off-by: yihuaz <[email protected]>
htuch
left a comment
There was a problem hiding this comment.
LGTM, will hand this over to @antoniovicente for final approval/merge as CODEOWNER.
|
/retest multiarch is known to be flaky/broken. |
|
Retrying Azure Pipelines: |
|
Can you merge upstream/main ? I don't know what's up with the docker linux multiarch failure. Hopefully merging upstream/main will fix it. /wait |
|
It seems the same test still fails even after merging with upstream/main :( |
|
@antoniovicente, so I guess we need to wait until #14971 is resolved to merge this PR? |
|
/retest |
|
Retrying Azure Pipelines: |
It may be possible for someone with superuser permissions like @htuch to force the merge. Let's see if the most recent retry succeeds. |
This PR resolves the first issue described in #15296.
Note that we need to set the maximum frame size (16KB) in the following two places:
The frame size set in 1. will be used in the frame size negotiation by telling its peer what is the desired frame size for the sender. The frame size set in 2. will be used to compare with the peer's frame size to determine the final frame size to use.
We need to ensure the same frame size is used in 1. and 2.
Notice that both API's used in 1. and 2. are gRPC TSI surface API's (alts_tsi_handshaker_create() and tsi_handshaker_result_create_zero_copy_grpc_protector()) so all we need to ensure is to pass the same frame size to those API's. After this PR is merged, I will prepare for a patch to update the max frame size used in the internal TSI handshaker.