Skip to content

Commit 7e40dfd

Browse files
committed
Merge #80: Client: Drop script subscriptions to free lock
aa0b957 Client: Drop script subscriptions to free lock (Sebastian Kung) Pull request description: This fixes a supposed deadlock when the reader thread receives a script subscription notification from the server before it receives a subscribing response. I am not 100% sure if this actually fixes a deadlock, but I ran into this in a regtest setup where a bunch of subscriptions were made, while some script notifications could be processed in parallel. My test failed sporadically with the electrum client locking up completely and adding this drop made the tests consistently pass again. ACKs for top commit: afilini: ACK aa0b957, makes a lot of sense! Tree-SHA512: b1bbea71fb56a189081b9aa602f768ef50d349a6ad6f3a3f64264259954a541fee85cad84461afeafe1ba17e11950c18fdcadb7c47a5fa1b3ce2fa2ac1cdcdc0
2 parents c34fde5 + aa0b957 commit 7e40dfd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/raw_client.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,7 @@ impl<T: Read + Write> ElectrumApi for RawClient<T> {
827827
}
828828

829829
script_notifications.insert(script_hash, VecDeque::new());
830+
drop(script_notifications);
830831

831832
let req = Request::new_id(
832833
self.last_id.fetch_add(1, Ordering::SeqCst),

0 commit comments

Comments
 (0)