Closed johncantrell97 closed 2 years ago
@johncantrell97 in the past I've used once-cell
to hold a runtime, might make it easier in this case, to avoid passing the runtime handles around.
use once_cell::sync::{Lazy, OnceCell};
pub static SENSEI_RUNTIME: Lazy<tokio::runtime::Runtime> = Lazy::new(|| {
tokio::runtime::Builder::new_multi_thread()
.worker_threads(10)
.thread_name("sensei")
.enable_all()
.build()
.unwrap();
});
I don't believe that this should be required. I'd really like to understand where the issue lies before we fall down this path.
Ah, if @devrandom is right at https://github.com/lightningdevkit/rust-lightning/issues/1367#issuecomment-1129092514 then I think a much simpler approach would be to just create a single threaded runtime in place in the persister. This would also make it simpler to just revert the changes after https://github.com/lightningdevkit/rust-lightning/issues/1470 . I'm not aware of any other lock issues as there's not much other reentrancy in LDK.
going to close this in favor of the hopefully simpler workaround
An attempt to avoid running into deadlocks when ldk is holding mutexes and we need to block in ldk user land.
Need to test this patch with devrandom's python tests