-
Notifications
You must be signed in to change notification settings - Fork 313
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
Make sure to always write out end-of-stream markers during encoding #7796
Conversation
@rerun-bot full-check |
Started a full build: https://github.com/rerun-io/rerun/actions/runs/11381591566 |
I can confirm this fixes the |
@@ -120,15 +179,20 @@ impl<W: std::io::Write> Encoder<W> { | |||
} | |||
} | |||
|
|||
// NOTE: This cannot be done in a `Drop` implementation because of `Self::into_inner` which | |||
// does a partial move. | |||
#[inline] | |||
pub fn finish(&mut self) -> Result<(), EncodeError> { | |||
MessageHeader::EndOfStream.encode(&mut self.write)?; | |||
Ok(()) |
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.
We could warn in Drop if this hasn't been called, at least in debug builds
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.
Not sure what you mean? We cannot implement Drop
for Encoder
?
Saving Rerun RRD data can happen in many, many different ways, and it must always make sure to include the end-of-stream marker.
This is unfortunately not trivial because many things want to partial move out of
Encoder
, which rules outimpl Drop
.This PR introduces a
DroppableEncoder
that can be used in many cases, or makes sure to properlyfinish()
otherwise.This fixes half of the issues described in:
rr.log_file_from_path
just hangs indefinitely #7791Checklist
main
build: rerun.io/viewernightly
build: rerun.io/viewerCHANGELOG.md
and the migration guideTo run all checks from
main
, comment on the PR with@rerun-bot full-check
.