-
Notifications
You must be signed in to change notification settings - Fork 97
Error logging in converters [DEVINFRA-1018] #1244
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
Conversation
silverjam
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we do the same thing for fatal errors too?
yep but will need to take until inclusive or chain (?) or just panic on the filter map 🤔 which i have just opted for the panic ^^ another bug (?) that arises json2sbp never terminates i.e. will not terminate which might look into (?) but we have the above might be the reason why sometimes it doesn't produce back the entire sbp file, hanging the decoder |
…nto adrian/sbp_converters_logging
|
If we don't dump the buffer on EOF errors, we terminate processing but we also don't capture the error, for example: Versus previously |
|
@adrian-kong You're change is probably correct, but it would be nice if we could detect an EOF error where we're at the true end of a stream vs an EOF in the decoder, which looks like it can also happen when we the buffer doesn't contain an entire JSON message. |
|
@adrian-kong I wonder how hard it would be to add some integration tests for the error message? |
| fn new() -> Self { | ||
| JsonDecoder { | ||
| payload_buf: Vec::with_capacity(BUFLEN), | ||
| eof_seen: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was trying to figure out a better way instead of holding this - felt hacky but i guess it works 👍 - or maybe just eprintln inside decode, thought the dencode errors meant retry decoding so we needed two error types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree that the solution is a bit hacky. However, since these are library functions, it didn't feel right to add eprintln there (printing errors should be an application layer behavior).
Description
Logs error, terminates the unterminating json bug
JIRA Reference
https://swift-nav.atlassian.net/browse/DEVINFRA-1018