Fix block_on usage in connect#2033
Closed
avinassh wants to merge 2 commits intotursodatabase:mainfrom
Closed
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR addresses issue #2032 by fixing the usage of tokio’s block_on functionality in the database bootstrap process. Key changes include:
- Replacing the previous tokio::task::block_in_place call with a conditional branch based on the presence of a synchronization context.
- Introducing a new branch to handle runtime availability via tokio::runtime::Handle::try_current(), with distinct handling for when a current runtime exists and when it does not.
Comments suppressed due to low confidence (1)
libsql/src/database.rs:695
- Consider handling potential errors when building the Tokio runtime instead of using unwrap(), to avoid an unexpected panic in production environments.
.build().unwrap();
19fa75a to
84c2239
Compare
Member
Author
|
Okay, this might not be the proper way to handle this. https://greptime.com/blogs/2023-03-09-bridging-async-and-sync-rust |
block_onblock_on usage in connect
penberg
approved these changes
Apr 17, 2025
84c2239 to
652f432
Compare
Collaborator
|
Closing as obsolete |
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.
fixes #2032