Implement support for fully asynchronous QueryHandles #7964
Merged
Conversation
Member
Author
|
@rerun-bot full-check |
|
Started a full build: https://github.com/rerun-io/rerun/actions/runs/11617886895 |
jleibs
reviewed
Oct 31, 2024
|
|
||
| let state = self.init(); | ||
| // That's a synchronous lock, so make sure we barely lock it. | ||
| let state = self.init_(store, cache); |
Member
There was a problem hiding this comment.
This looks suspicious to me -- the body of that function is large and I wouldn't expect us to execute that code unless we aren't able to access self.state.
Why isn't this:
self.state.get_or_init(|| self.init_(store, cache))
Member
Author
There was a problem hiding this comment.
Uh-oh, nice catch. I meant to add a non-blocking optimistic check that comes first.
But now that I think about it, this is in QueryHandle, so realistically nothing will ever contend on this... we can probably just do it all in the OnceLock yeah.
jleibs
approved these changes
Oct 31, 2024
zehiko
approved these changes
Oct 31, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds non-blocking methods to all our new shiny storage handles, and uses these new non-blocking primitives to implement asynchronous helpers (read:
Futures) in ourQueryHandle.These helpers are then used on the other side to implement a proper
Stream.In particular, all read locks are now recursive, always.
Recursive locks are mandatory for two reasons:
Checklist
mainbuild: rerun.io/viewernightlybuild: rerun.io/viewerCHANGELOG.mdand the migration guideTo run all checks from
main, comment on the PR with@rerun-bot full-check.