File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
lightning-background-processor/src Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -206,10 +206,17 @@ impl BackgroundProcessor {
206206 channel_manager. process_pending_events ( & event_handler) ;
207207 chain_monitor. process_pending_events ( & event_handler) ;
208208
209- // Note that the PeerManager process_events may block on ChannelManager's locks,
210- // hence it comes last here. When the ChannelManager finishes whatever its doing,
209+ // Note that the PeerManager:: process_events may block on ChannelManager's locks,
210+ // hence it comes last here. When the ChannelManager finishes whatever it's doing,
211211 // we want to ensure we get into `persist_manager` as quickly as we can, especially
212212 // without running the normal event processing above and handing events to users.
213+ //
214+ // Specifically, on an *extremely* slow machine, we may see ChannelManager start
215+ // processing a message effectively at any point during this loop. In order to
216+ // minimize the time between such processing completing and persisting the updated
217+ // ChannelManager, we want to minimize methods blocking on a ChannelManager
218+ // generally, and as a fallback place such blocking only immediately before
219+ // persistence.
213220 peer_manager. process_events ( ) ;
214221
215222 // We wait up to 100ms, but track how long it takes to detect being put to sleep,
You can’t perform that action at this time.
0 commit comments