Skip to content
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

use separate runtime for ldk tasks #74

Closed
wants to merge 1 commit into from
Closed

Conversation

johncantrell97
Copy link
Contributor

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

@praveenperera
Copy link
Contributor

praveenperera commented May 17, 2022

@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();
});

@TheBlueMatt
Copy link

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.

@TheBlueMatt
Copy link

Ah, if @devrandom is right at lightningdevkit/rust-lightning#1367 (comment) 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 lightningdevkit/rust-lightning#1470 . I'm not aware of any other lock issues as there's not much other reentrancy in LDK.

@johncantrell97
Copy link
Contributor Author

going to close this in favor of the hopefully simpler workaround

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants