We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 81a4bd1 commit 3d0bb59Copy full SHA for 3d0bb59
lightning-net-tokio/src/lib.rs
@@ -194,6 +194,13 @@ impl Connection {
194
},
195
}
196
let _ = event_waker.try_send(());
197
+
198
+ // At this point we've processed a message or two, and reset the ping timer for this
199
+ // peer, at least in the "are we still receiving messages" context, if we don't give up
200
+ // our timeslice to another task we may just spin on this peer, starving other peers
201
+ // and eventually disconnecting them for ping timeouts. Instead, we explicitly yield
202
+ // here.
203
+ tokio::task::yield_now().await;
204
};
205
let writer_option = us.lock().unwrap().writer.take();
206
if let Some(mut writer) = writer_option {
0 commit comments