Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce streaming #107

Merged
merged 8 commits into from
Apr 18, 2022
Merged

Introduce streaming #107

merged 8 commits into from
Apr 18, 2022

Conversation

dmcgowan
Copy link
Member

@dmcgowan dmcgowan commented Mar 9, 2022

Add implementation of streaming and generator for protoc-gen-go-ttrpc. Currently no generator implementation for protoc-gen-gogottrpc

@codecov-commenter
Copy link

codecov-commenter commented Mar 9, 2022

Codecov Report

Merging #107 (9bc00a1) into main (b194a10) will decrease coverage by 1.32%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #107      +/-   ##
==========================================
- Coverage   63.29%   61.97%   -1.33%     
==========================================
  Files          11       12       +1     
  Lines        1049     1299     +250     
==========================================
+ Hits          664      805     +141     
- Misses        341      425      +84     
- Partials       44       69      +25     
Impacted Files Coverage Δ
src/github.com/containerd/ttrpc/client.go 64.68% <0.00%> (-10.94%) ⬇️
src/github.com/containerd/ttrpc/channel.go 73.17% <0.00%> (-8.37%) ⬇️
src/github.com/containerd/ttrpc/server.go 73.52% <0.00%> (-2.49%) ⬇️
src/github.com/containerd/ttrpc/interceptor.go 100.00% <0.00%> (ø)
src/github.com/containerd/ttrpc/stream.go 81.48% <0.00%> (ø)
src/github.com/containerd/ttrpc/services.go 60.24% <0.00%> (+12.52%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b194a10...9bc00a1. Read the comment docs.

@dmcgowan dmcgowan force-pushed the introduce-streaming branch 12 times, most recently from 245af9b to 9bc00a1 Compare March 15, 2022 03:04
@dmcgowan dmcgowan marked this pull request as ready for review March 15, 2022 16:47
@dmcgowan
Copy link
Member Author

Marking this as ready for review

Benchmarking not showing a significant difference (only comparing unary requests obviously). There is one extra allocation in the new code, likely related to the new stream structure.

name                        old time/op    new time/op    delta
RoundTripUnixSocketCreds-8    26.3µs ± 0%    27.0µs ± 0%   ~     (p=1.000 n=1+1)
RoundTrip-8                   27.2µs ± 0%    25.5µs ± 0%   ~     (p=1.000 n=1+1)

name                        old alloc/op   new alloc/op   delta
RoundTripUnixSocketCreds-8    1.18kB ± 0%    1.31kB ± 0%   ~     (p=1.000 n=1+1)
RoundTrip-8                   1.18kB ± 0%    1.34kB ± 0%   ~     (p=1.000 n=1+1)

name                        old allocs/op  new allocs/op  delta
RoundTripUnixSocketCreds-8      27.0 ± 0%      28.0 ± 0%   ~     (p=1.000 n=1+1)
RoundTrip-8                     27.0 ± 0%      28.0 ± 0%   ~     (p=1.000 n=1+1)

@dmcgowan dmcgowan added this to the 1.7 milestone Mar 15, 2022
Copy link
Member

@stevvooe stevvooe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Protobuild.toml Outdated
# enable ttrpc and disable fieldpath and grpc for the shim
prefixes = ["github.com/containerd/ttrpc/integration/streaming"]
generators = ["go", "go-ttrpc"]
plugins = ["ttrpc"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't have to have the plugins = here.

Implementation of the 1.2 protocol with support for streaming. Provides
the client and server interfaces for implementing services with
streaming.

Unary behavior is mostly unchanged and avoids extra stream tracking just
for unary calls. Streaming calls are tracked to route data to the
appropriate stream as it is received.

Stricter stream ID handling, disallowing unexpected re-use of stream
IDs.

Signed-off-by: Derek McGowan <derek@mcg.dev>
Signed-off-by: Derek McGowan <derek@mcg.dev>
Signed-off-by: Derek McGowan <derek@mcg.dev>
Signed-off-by: Derek McGowan <derek@mcg.dev>
Signed-off-by: Derek McGowan <derek@mcg.dev>
Add flag to indicate that a data message used with a close flag
is not sending any data. This clears up any ambiguity over whether the
final data message is transmitting a zero length data message or no
data at all.

Signed-off-by: Derek McGowan <derek@mcg.dev>
Signed-off-by: Derek McGowan <derek@mcg.dev>
Signed-off-by: Derek McGowan <derek@mcg.dev>
@kzys kzys merged commit 6283342 into containerd:main Apr 18, 2022
@dmcgowan dmcgowan deleted the introduce-streaming branch April 18, 2022 17:12
@dmcgowan dmcgowan mentioned this pull request Apr 19, 2022
pacoxu added a commit to pacoxu/ttrpc that referenced this pull request Jun 9, 2022
containerd#107

Signed-off-by: Paco Xu <paco.xu@daocloud.io>
@pacoxu pacoxu mentioned this pull request Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants