Skip to content

Commit

Permalink
Handle the extra StoreInfo from memory_sink (#6207)
Browse files Browse the repository at this point in the history
### What
Fixes a test failure on main.

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested the web demo (if applicable):
* Using examples from latest `main` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/6207?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/6207?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG
* [x] If applicable, add a new check to the [release
checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!

- [PR Build Summary](https://build.rerun.io/pr/6207)
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

To run all checks from `main`, comment on the PR with `@rerun-bot
full-check`.
  • Loading branch information
jleibs authored May 2, 2024
1 parent aef7f40 commit a9c9706
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions crates/re_sdk/src/recording_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,11 @@ impl RecordingStreamBuilder {

let sink = crate::log_sink::MemorySink::new(rec.clone());
let storage = sink.buffer();
// Using set_sink here is necessary because the MemorySink needs to know
// it's own RecordingStream, which means we can't use `new` above.
// This has the downside of a bit of creation overhead and an extra StoreInfo
// message being sent to the sink.
// TODO(jleibs): Figure out a cleaner way to handle this.
rec.set_sink(Box::new(sink));
Ok((rec, storage))
}
Expand Down Expand Up @@ -2224,6 +2229,16 @@ mod tests {
_ => panic!("expected SetStoreInfo"),
}

// For reasons, MemorySink ends up with 2 StoreInfos.
// TODO(jleibs): Avoid a redundant StoreInfo message.
match msgs.pop().unwrap() {
LogMsg::SetStoreInfo(msg) => {
assert!(msg.row_id != RowId::ZERO);
similar_asserts::assert_eq!(store_info, msg.info);
}
_ => panic!("expected SetStoreInfo"),
}

// MemorySinkStorage transparently handles flushing during `take()`!

// The batched table itself, which was sent as a result of the explicit flush above.
Expand Down

0 comments on commit a9c9706

Please sign in to comment.