File tree 2 files changed +15
-0
lines changed
2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 3
3
- Use ` web-time ` instead of ` instant ` .
4
4
See [ PR 5347] ( https://github.com/libp2p/rust-libp2p/pull/5347 ) .
5
5
6
+ - Fix panic in WASM caused by retrying on dial upgrade errors.
7
+ See [ PR 5447] ( https://github.com/libp2p/rust-libp2p/pull/5447 ) .
8
+
6
9
## 0.44.1
7
10
8
11
- Impose ` Sync ` on ` ping::Failure::Other ` .
Original file line number Diff line number Diff line change @@ -184,6 +184,18 @@ impl Handler {
184
184
) {
185
185
self . outbound = None ; // Request a new substream on the next `poll`.
186
186
187
+ // Timer is already polled and expired before substream request is initiated
188
+ // and will be polled again later on in our `poll` because we reset `self.outbound`.
189
+ //
190
+ // `futures-timer` allows an expired timer to be polled again and returns
191
+ // immediately `Poll::Ready`. However in its WASM implementation there is
192
+ // a bug that causes the expired timer to panic.
193
+ // This is a workaround until a proper fix is merged and released.
194
+ // See libp2p/rust-libp2p#5447 for more info.
195
+ //
196
+ // TODO: remove when async-rs/futures-timer#74 gets merged.
197
+ self . interval . reset ( Duration :: new ( 0 , 0 ) ) ;
198
+
187
199
let error = match error {
188
200
StreamUpgradeError :: NegotiationFailed => {
189
201
debug_assert_eq ! ( self . state, State :: Active ) ;
You can’t perform that action at this time.
0 commit comments