-
Notifications
You must be signed in to change notification settings - Fork 465
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
ore: pend in wait_and_assert_finished instead of yielding once #23588
Conversation
bc63dd1
to
4fb6158
Compare
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.
Triggered nightly, would appreciate waiting for the result: https://buildkite.com/materialize/nightlies/builds/5446
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.
The new API is SO good!
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.
Nightly seems good except this failure: https://buildkite.com/materialize/nightlies/builds/5446#018c2275-b361-4315-b7af-0aedaa249180
After ingesting data we had a hang. I'm not sure if it's related to this PR, retriggered.
4fb6158
to
d85832b
Compare
rebased, fixed nits, re-triggered nightlies |
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.
🎉
.await | ||
.into_iter() | ||
.map(JoinHandle::abort_on_drop) | ||
.collect(), |
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.
I defer to @danhhz, but the reason I had the explicit Drop
impl was to avoid the reallocation. Could plausibly not matter at all here, but when I wrote the Drop
impl I wasn't sure so I erred on the side of caution.
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.
"The reallocation" here is a second vec? I'd say that's fine here, this gets called 1:1 with registered a reader, which is an expensive operation
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.
Yep, exactly.
@benesch i think this is ready for another look |
A singular
yield_now
is not sufficient to yield a task to the tokio runtime if theJoinHandle
is being selected or used in things likeFuturesUnordered
, so instead, we pend forever. To prevent misuse causing deadlocks, I also altered the return value ofmz_ore
spawn methods/functions to return a type that uses ownership to prevent users from aborting a task and also callingwait_and_assert_finished
fixes a flake described here: https://materializeinc.slack.com/archives/C01CFKM1QRF/p1701365433621259 (and elsewhere)
Motivation
Checklist
$T ⇔ Proto$T
mapping (possibly in a backwards-incompatible way), then it is tagged with aT-proto
label.