Commit 9200d45
committed
feat(kad): configurable outbound_substreams timeout
Then testing `put_record_to` with poor connectioin but large packet size (around 4MB), the `put_record_to` frequently got failed and the PutRecordToError::stats showing always failed at 10s.
```
"kad_event::PutRecordError::QuorumFailed", required quorum 2, stored on [], QueryStats { requests: 5, success: 0, failure: 5, start: Some(Instant { tv_sec: 121323, tv_nsec: 961187829 }), end: Some(Instant { tv_sec: 121334, tv_nsec: 188694869 }) } - ProgressStep { count: 1, last: true }
```
However, this timeout is not defined by request/response protocol timeout (which in our case increased to 30s already).
Further digging through the libp2p code, it turned out this timeout is actually affected by outbound_substreams timeout.
We tested with increase to 30s, do see much less put_record_to failure and QueryStats showing extended completion duration (larger than 10s, and in case of failed, to be 30s).
Hence raised this PR to provide a configurable approach of the timeout.
Pull-Request: libp2p#6015.1 parent 9698607 commit 9200d45
File tree
4 files changed
+30
-2
lines changed- protocols/kad
- src
4 files changed
+30
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
382 | 382 | | |
383 | 383 | | |
384 | 384 | | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
385 | 395 | | |
386 | 396 | | |
387 | 397 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
| |||
453 | 452 | | |
454 | 453 | | |
455 | 454 | | |
| 455 | + | |
| 456 | + | |
456 | 457 | | |
457 | 458 | | |
458 | 459 | | |
| |||
461 | 462 | | |
462 | 463 | | |
463 | 464 | | |
464 | | - | |
| 465 | + | |
465 | 466 | | |
466 | 467 | | |
467 | 468 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
| |||
145 | 147 | | |
146 | 148 | | |
147 | 149 | | |
| 150 | + | |
| 151 | + | |
148 | 152 | | |
149 | 153 | | |
150 | 154 | | |
| |||
153 | 157 | | |
154 | 158 | | |
155 | 159 | | |
| 160 | + | |
156 | 161 | | |
157 | 162 | | |
158 | 163 | | |
| |||
165 | 170 | | |
166 | 171 | | |
167 | 172 | | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
168 | 183 | | |
169 | 184 | | |
170 | 185 | | |
| |||
0 commit comments