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

[RSDK-8489] Implement local webrtc signaling #347

Merged
merged 4 commits into from
Nov 11, 2024

Conversation

acmorrow
Copy link
Member

@acmorrow acmorrow commented Nov 6, 2024

I will add inline annotations to provide context on the current state of things, and what needs to happen next.

Copy link
Member Author

@acmorrow acmorrow left a comment

Choose a reason for hiding this comment

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

Here are some comments, TODOs, and guideposts for this review. Some of these I will fold into comments before merging, others will become TODOs and tickets.

micro-rdk/Cargo.toml Show resolved Hide resolved
micro-rdk/src/common/conn/server.rs Show resolved Hide resolved
micro-rdk/src/common/conn/viam.rs Show resolved Hide resolved
micro-rdk/src/common/conn/viam.rs Show resolved Hide resolved
micro-rdk/src/common/conn/viam.rs Show resolved Hide resolved
micro-rdk/src/common/conn/viam.rs Show resolved Hide resolved
Copy link
Member

@gvaradarajan gvaradarajan left a comment

Choose a reason for hiding this comment

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

Just a first pass, still trying to understand how everything fits together before I dive deeper

micro-rdk/src/common/grpc.rs Outdated Show resolved Hide resolved
micro-rdk/src/common/grpc.rs Show resolved Hide resolved
micro-rdk/src/common/grpc.rs Show resolved Hide resolved
micro-rdk/src/common/grpc.rs Show resolved Hide resolved
micro-rdk/src/common/webrtc/api.rs Outdated Show resolved Hide resolved
Copy link
Member

@gvaradarajan gvaradarajan left a comment

Choose a reason for hiding this comment

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

Minor second pass, will do a final one after you've made all the changes you want to make from your own comments as well

micro-rdk/src/common/grpc.rs Show resolved Hide resolved
Err(e) => {
log::error!("error sending signaling message: {:?}", e);
Err(WebRtcError::SignalingDisconnected())
match self.signaling.as_mut() {
Copy link
Member

Choose a reason for hiding this comment

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

could some of this be simplified by a function like fn send_answer_stage(&mut self, uuid: String, stage: AnswerStage) -> Result<(), WebRtcError>?

Copy link
Member Author

Choose a reason for hiding this comment

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

@gvaradarajan - I'm not quite sure I see what you are saying. Could you clarify? the Answer stuff doesn't come into play at all for local signaling.

- Don't interpret PEER_CLOSE_NOTIFY as a hard error
- Use an unbounded channel with blocking send to forward along call updates
- Don't fail CallUpdate RPCs that race with a completed Call RPC.
Copy link
Member

@npmenard npmenard left a comment

Choose a reason for hiding this comment

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

LGTM mainly some nits. We should merge and start testing it.
I think further work should focus on removing code duplication in webrtc/api.rs and simplify both the rpc stream and the local signaling machinery so the flow is easier to understand.
I would also like to have local signaling be a configurable option in the builder.

micro-rdk/src/common/grpc.rs Show resolved Hide resolved
micro-rdk/src/common/grpc.rs Show resolved Hide resolved
micro-rdk/src/common/grpc.rs Show resolved Hide resolved
micro-rdk/src/common/webrtc/api.rs Show resolved Hide resolved
micro-rdk/src/common/grpc.rs Show resolved Hide resolved
@acmorrow
Copy link
Member Author

Per discussion with @npmenard, I'm merging this in its current state, and I'll address comments and add ticketed TODOs in a near-term follow-up PR.

@acmorrow acmorrow merged commit 8e277ee into viamrobotics:main Nov 11, 2024
6 checks passed
Copy link
Member Author

@acmorrow acmorrow left a comment

Choose a reason for hiding this comment

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

Follow-ups on open comments. I will create a new PR with changes where they were made in response to notes here.

micro-rdk/src/common/webrtc/api.rs Show resolved Hide resolved
micro-rdk/src/common/webrtc/api.rs Show resolved Hide resolved
micro-rdk/src/common/grpc.rs Show resolved Hide resolved
micro-rdk/src/common/grpc.rs Show resolved Hide resolved
micro-rdk/src/common/grpc.rs Show resolved Hide resolved
micro-rdk/src/common/grpc.rs Show resolved Hide resolved
Err(e) => {
log::error!("error sending signaling message: {:?}", e);
Err(WebRtcError::SignalingDisconnected())
match self.signaling.as_mut() {
Copy link
Member Author

Choose a reason for hiding this comment

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

@gvaradarajan - I'm not quite sure I see what you are saying. Could you clarify? the Answer stuff doesn't come into play at all for local signaling.

@acmorrow
Copy link
Member Author

Changes in response to comments are in #349

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.

3 participants