-
Notifications
You must be signed in to change notification settings - Fork 117
Closed
Description
The Drop implementation for Node calls Node::stop():
Lines 1748 to 1752 in 3f1c842
| impl Drop for Node { | |
| fn drop(&mut self) { | |
| let _ = self.stop(); | |
| } | |
| } |
And Node::stop() blocks the runtime:
Lines 849 to 855 in 3f1c842
| let timeout_res = runtime.block_on(async { | |
| tokio::time::timeout( | |
| Duration::from_secs(100), | |
| event_handling_stopped_receiver.changed(), | |
| ) | |
| .await | |
| }); |
This makes it unsafe to drop a Node when running in an async context, leading to this issue in the Fedimint LDK lightning gateway.
This is a big foot-gun. We should be able to drop a Node in either a sync or async context.
Metadata
Metadata
Assignees
Labels
No labels