-
Notifications
You must be signed in to change notification settings - Fork 406
Open
Description
Consider this code (introduced via this PR: #2029)
Lines 685 to 695 in 10f5dd8
let _ = tokio::task::block_in_place(move || { | |
let rt = tokio::runtime::Builder::new_current_thread() | |
.enable_all() | |
.build() | |
.unwrap(); | |
rt.block_on(async { | |
// we will ignore if any errors occurred during the bootstrapping the db, | |
// because the client could be offline when trying to connect. | |
let _ = db.bootstrap_db().await; | |
}) | |
}); |
If libsql library is used in a single threaded environment, then it fails with following error:
can call blocking only when running on the multi-threaded runtime
This is happening due to incorrect use of block_in_place
which should be used only in multiple threaded environments.