-
Notifications
You must be signed in to change notification settings - Fork 130
Convert handles to hold weak reference to their executor #4624
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
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
| /// The future is provided a [`Handle`] to the runtime so that it may spawn additional tasks | ||
| /// to be executed concurrently. | ||
| fn block_on<Fut, R>(&self, f: Fut) -> R | ||
| fn block_on<F, Fut, R>(&self, f: F) -> R |
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 change the API to take a handle so it's harder to write code that drops the runtime too early.
It would be impossible to write code that drops the runtime too early if we could embed a lifetime in the handle. But alas. My week long dive into Rust revealed this is simply not possible :'(
Signed-off-by: Nicholas Gates <nick@nickgates.com>
CodSpeed Performance ReportMerging #4624 will not alter performanceComparing Summary
|
Codecov Report❌ Patch coverage is ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Nicholas Gates <nick@nickgates.com>
robert3005
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.
the statics inside functions are a bit weird style but they work
This PR moves our I/O layer over from the old pre-fetching segment source to the new coalescing File I/O implementation on the Vortex runtime. Note: this PR currently includes #4624 ## Breaking Changes * `VortexOpenOptions` is no longer generic. * Fix: find/replace `VortexOpenOptions::file` -> `VortexOpenOptions::new` * `VortexOpenOptions::in_memory().open(...)` is replaced by `VortexOpenOptions::new().open_buffer(...)` ## Performance Generally this PR is about even, or slightly improved. There is some variance on some of the S3 benchmarks. The big regressions are in DuckDB on S3, where our read path has a custom work-stealing queue that doesn't buffer enough of the scan to perform effective pre-fetching. DataFusion doesn't have this problem, so we see much less of an impact. I want to follow up to this PR to switch over DuckDB to avoid this getting large, and accept the short-term regression. --------- Signed-off-by: Nicholas Gates <nick@nickgates.com>
This fixes a problem where we can spawn a task that holds onto handle (since it has a static lifetime, ergh) can keep a runtime alive even after the caller drops it. For futures that use channels, e.g. the FileRead I/O, this results in read futures that hang forever when the runtime is dropped (because the executor holds the pending recv end of the channel, and the executor is kept alive by the send end of the channel...)
We also impl BlockingRuntime for CurrentThreadRuntime as this will likely become the default runtime for language bindings to use.