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-2407 - Fix gRPC error logging #40

Merged
merged 5 commits into from
Apr 5, 2023

Conversation

stuqdog
Copy link
Member

@stuqdog stuqdog commented Mar 31, 2023

Major changes:

  • When receiving gRPC errors, log but do not return as error (the error will still be received by users from the top level call function, but this avoids confusing errors that imply that any gRPC call error is a rust deserialization problem)
  • Remove close_sync - this function was failing before because of issues creating runtimes within runtimes, which caused noisy and erroneous error messages to log when shutting down
  • Add logging when dropping WebRTCBaseChannel to show that - despite removing the close_sync - we are in fact successfully dropping WebRTCBaseChannels when done with them.

@stuqdog stuqdog requested a review from a team as a code owner March 31, 2023 19:01
@stuqdog stuqdog requested review from cheukt and removed request for a team March 31, 2023 19:01
Err(err)
}
if let Some(e) = &err {
log::error!("received gRPC error: {e}");
Copy link
Member Author

Choose a reason for hiding this comment

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

I went with error level logging here just to increase visibility and because it is definitely an error. However, this may be overkill since we'll still be getting an error from call? Happy to update to debug level if people think that's preferred.

Copy link
Contributor

Choose a reason for hiding this comment

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

I say debug!

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 for debug

Copy link
Member Author

Choose a reason for hiding this comment

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

debug it is!

@stuqdog
Copy link
Member Author

stuqdog commented Apr 3, 2023

Note to reviewers: build is currently failing due to an upstream issue, being tracked/hopefully resolved here.

Comment on lines +30 to +32
fn drop(&mut self) {
log::debug!("Dropping base channel {self:?}");
}
Copy link
Contributor

Choose a reason for hiding this comment

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

i'm a little confused by this logic - where do we actually drop the channel object? or is the whole point of this PR that it's happening elsewhere so we should only log here?

Copy link
Member Author

Choose a reason for hiding this comment

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

drop() is what's called when something leaves scope. So if this calls that means the base_channel is definitely dropped. The log just provides verification

@maximpertsov maximpertsov mentioned this pull request Apr 4, 2023
3 tasks
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

@stuqdog stuqdog merged commit c10e5c1 into viamrobotics:main Apr 5, 2023
@stuqdog stuqdog deleted the fix-constant-error-logging branch April 6, 2023 12:11
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.

4 participants