Skip to content

Add ttrpc protocol definition#102

Merged
dmcgowan merged 1 commit intocontainerd:mainfrom
dmcgowan:protocol-definition
Mar 3, 2022
Merged

Add ttrpc protocol definition#102
dmcgowan merged 1 commit intocontainerd:mainfrom
dmcgowan:protocol-definition

Conversation

@dmcgowan
Copy link
Member

Adds a more formalized protocol definition.

Expands the definition for streaming support. The implementation for streaming support is still a work in progress.

@dmcgowan
Copy link
Member Author

We can also put this in a separate markdown document or even in the Readme. Initially I was thinking for showing up in go doc, but there is more than just the go implementation now.

@cpuguy83
Copy link
Member

btw, if we put this in a markdown: https://github.blog/2022-02-14-include-diagrams-markdown-files-mermaid/

You can add diagrams inline in the markdown.

Copy link
Member

@kzys kzys left a comment

Choose a reason for hiding this comment

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

Looks good to me. It may be better to have a plain Markdown file in a separate directory for utilizing Markdown-related tooling though.

@dmcgowan dmcgowan force-pushed the protocol-definition branch from c6159de to a64f783 Compare February 22, 2022 02:13
@dmcgowan
Copy link
Member Author

@cpuguy83 I saw news about that and am definitely interested in that. Initially was just trying for a nice txt friendly format, but I can play around with it.

Moved to a markdown file, I agree it is the better approach.

I also need to update the versioning some since I see we already have a 1.1

@dmcgowan dmcgowan force-pushed the protocol-definition branch from a64f783 to eed841a Compare February 22, 2022 04:51
@dmcgowan
Copy link
Member Author

Updated version, going to mark as ready for review

@dmcgowan dmcgowan marked this pull request as ready for review February 22, 2022 04:51
PROTOCOL.md Outdated
The ttrpc protocol is designed to be lightweight and optimized for low latency
and reliable connections between processes on the same host. The protocol does
not include features for handling unreliable connections such as handshakes,
resets, pings, or flow control. The protocol is designed to be easy to implement
Copy link
Member

Choose a reason for hiding this comment

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

s/easy/light/

Copy link
Member Author

Choose a reason for hiding this comment

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

The statement is intending to say that low overhead implementations are easy. Not sure about the wording and I can see that isn't exactly clear. Replacing easy with light doesn't convey that point though.

Copy link
Member

Choose a reason for hiding this comment

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

"The protocol is designed to make low-overhead implementations as simple as possible"

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated

PROTOCOL.md Outdated
streams since both client and server need to track additional state. To keep
this management as simple as possible, ttrpc minimizes the number of states and
uses two flags instead of control frames. Each stream has two states while a
stream is still alive, local closed and remote closed. Each peer considers
Copy link
Member

Choose a reason for hiding this comment

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

"alive: local closed and remote closed."

both local and remote closed, the stream is considered finished and may be
cleaned up.

Due to the asymmetric nature of the current protocol, a client should
Copy link
Member

Choose a reason for hiding this comment

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

Maybe always enclose local close and remote closed in backticks?

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated to be more consistent on referring to those states

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

Took a quick pass and it looks reasonable.

@dmcgowan dmcgowan force-pushed the protocol-definition branch 2 times, most recently from 986dee9 to c227b9c Compare February 23, 2022 02:07
@containerd containerd deleted a comment from codecov-commenter Feb 23, 2022
@codecov-commenter
Copy link

codecov-commenter commented Feb 23, 2022

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.67%. Comparing base (aa5c947) to head (30684b0).
⚠️ Report is 105 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #102      +/-   ##
==========================================
- Coverage   63.87%   63.67%   -0.20%     
==========================================
  Files          11       11              
  Lines        1049     1049              
==========================================
- Hits          670      668       -2     
- Misses        334      336       +2     
  Partials       45       45              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dmcgowan dmcgowan force-pushed the protocol-definition branch from c227b9c to 00f9546 Compare February 23, 2022 02:08
Signed-off-by: Derek McGowan <[email protected]>
@dmcgowan dmcgowan force-pushed the protocol-definition branch from 00f9546 to 30684b0 Compare March 2, 2022 19:42
@dmcgowan
Copy link
Member Author

dmcgowan commented Mar 2, 2022

Updated, this should be ready to go now

Copy link
Member

@cpuguy83 cpuguy83 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@estesp estesp left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@kzys kzys left a comment

Choose a reason for hiding this comment

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

LGTM. Let's merge!

@dmcgowan dmcgowan merged commit cefcdeb into containerd:main Mar 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants