File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -109,7 +109,12 @@ impl<L: Deref + Clone + Send + Sync + 'static> RapidSyncProcessor<L> where L::Ta
109109 if config:: DOWNLOAD_NEW_GOSSIP {
110110 let ( mut persister, persistence_sender) =
111111 GossipPersister :: new ( self . logger . clone ( ) ) . await ;
112+
112113 log_info ! ( self . logger, "Starting gossip db persistence listener" ) ;
114+ // We persist gossip to postgres in a separate runtime as we can end up blocking on it
115+ // (indirectly via the async queue getting full) with sync mutexes held (esp
116+ // PeerManager's peers mutex). Otherwise, blocking on it could result in blocking the
117+ // tokio reactor which we're waiting on to complete postgres writes.
113118 let runtime = Builder :: new_multi_thread ( )
114119 . enable_all ( ) . worker_threads ( 2 ) . thread_name ( "postgres-writer" ) . build ( ) . unwrap ( ) ;
115120 runtime. spawn ( async move { persister. persist_gossip ( ) . await ; } ) ;
You can’t perform that action at this time.
0 commit comments