forked from grpc/grpc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[chaotic-good] Revamp wire format (grpc#37765)
Update the chaotic-good wire format with some learnings from the past year, and set up things for the next round of changes we'd like to make: * Instead of a composite FRAGMENT frame, split out CLIENT_INITIAL_METADATA, CLIENT_END_OF_STREAM, MESSAGE, SERVER_INITIAL_METADATA, SERVER_TRAILING_METADATA as separate frame types - this eliminates a ton of complexity in the transport, and corresponds to how we used the wire format in practice anyway. * Switch the frame payload for metadata, settings to be protobuf instead of HPACK - this eliminates the ordering requirements on interpreting these frames between streams, which I expect to open up some flexibility with head of line avoidance in the future. It's a heck of a lot easier to read and reason about the code. It's also easier to predict the size of the frame at encode time, which lets us treat metadata and payloads more uniformly in the protocol. * Add a connection id field to our header, in preparation for allowing multiple data connections * Allow payloads to be shipped on the control channel ('connection id 0') and use this for sending small messages Closes grpc#37765 COPYBARA_INTEGRATE_REVIEW=grpc#37765 from ctiller:tiefling 7b57f72 PiperOrigin-RevId: 695766541
- Loading branch information
1 parent
8342a10
commit 630d790
Showing
44 changed files
with
2,010 additions
and
1,744 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
src/core/ext/transport/chaotic_good/chaotic_good_frame.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Copyright 2024 The gRPC authors. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
syntax = "proto3"; | ||
|
||
package chaotic_good_frame; | ||
|
||
message Settings { | ||
// Connection id | ||
// - sent server->client on the control channel to specify the | ||
// data channel connection id | ||
// - sent client->server on the data channel to complete the | ||
// connection | ||
bytes connection_id = 1; | ||
// Flag true if this is a data channel (and not a control channel) | ||
bool data_channel = 2; | ||
// Requested alignment for the data channel | ||
// Client and server each send this with their preferences | ||
uint32 alignment = 3; | ||
} | ||
|
||
message UnknownMetadata { | ||
string key = 1; | ||
bytes value = 2; | ||
} | ||
|
||
message ClientMetadata { | ||
optional string path = 1; | ||
optional string authority = 2; | ||
optional uint64 timeout_ms = 3; | ||
|
||
repeated UnknownMetadata unknown_metadata = 100; | ||
} | ||
|
||
message ServerMetadata { | ||
optional uint32 status = 1; | ||
optional bytes message = 2; | ||
|
||
repeated UnknownMetadata unknown_metadata = 100; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.