Merge pull request #1972 from ZcashFoundation/peer-set-demand-deadlock-doc
Document peer set deadlock resistance
This commit is contained in:
parent
109ca4db86
commit
83b88f5b7a
|
@ -462,8 +462,14 @@ where
|
||||||
self.update_metrics();
|
self.update_metrics();
|
||||||
|
|
||||||
if self.preselected_p2c_index.is_none() {
|
if self.preselected_p2c_index.is_none() {
|
||||||
|
// CORRECTNESS
|
||||||
|
//
|
||||||
|
// If the channel is full, drop the demand signal rather than waiting.
|
||||||
|
// If we waited here, the crawler could deadlock sending a request to
|
||||||
|
// fetch more peers, because it also empties the channel.
|
||||||
trace!("no ready services, sending demand signal");
|
trace!("no ready services, sending demand signal");
|
||||||
let _ = self.demand_signal.try_send(());
|
let _ = self.demand_signal.try_send(());
|
||||||
|
|
||||||
// CORRECTNESS
|
// CORRECTNESS
|
||||||
//
|
//
|
||||||
// The current task must be scheduled for wakeup every time we
|
// The current task must be scheduled for wakeup every time we
|
||||||
|
|
Loading…
Reference in New Issue