Commit a041247
committed
feat: enhanced retry system with endpoint rotation and latency budget
Implemented comprehensive retry system improvements:
- Retry endpoint rotation: never reuse same endpoint on retry, select new endpoint following QoS/reputation rules
- Latency budget: configurable max_retry_latency (default 500ms) to prevent retrying slow requests
- Concurrency configuration: made max_parallel_endpoints, max_concurrent_relays, and max_batch_payloads configurable via YAML
- Endpoint exhaustion handling: exponential backoff (100ms, 200ms, 400ms) when all endpoints tried
Bug fixes:
- Fixed empty response handling in retry loops
- Fixed attempt number in retry metrics (removed incorrect +1)
- Fixed break/return in select statements
- Fixed empty endpoint domain in metrics recording
- Fixed Redis test to use testcontainer address
- Added missing error storage before loop breaks
- Enhanced context cancellation logging
Metrics improvements:
- Added endpoint_domain label to retry_latency metric
- Added retry_reason label to retry_budget_skipped metric
- New endpoint rotation metrics: shannon_retry_endpoint_switches_total, shannon_retry_endpoint_exhaustion_total
- All metrics follow lowercase_underscore naming convention
Configuration:
- Updated config schema with max_retry_latency and concurrency_config
- Added comprehensive examples in config.shannon_example.yaml
- Per-service override support for all retry and concurrency settings
Testing:
- Fixed Redis test conflicts by using testcontainer addresses
- Updated test mocks with GetConcurrencyConfig()
- E2E tests passing at 99.33% success rate (298/300 requests)1 parent 0d51476 commit a041247
File tree
57 files changed
+2391
-353
lines changed- cmd
- config
- examples
- e2e
- scripts
- gateway
- health
- metrics
- concurrency
- healthcheck
- reputation
- retry
- observation
- metadata
- protocol
- qos
- protocol/shannon
- qos
- evm
- solana
- reputation
- storage
- router
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
57 files changed
+2391
-353
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
315 | 320 | | |
316 | 321 | | |
317 | 322 | | |
| |||
497 | 502 | | |
498 | 503 | | |
499 | 504 | | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
521 | | - | |
522 | | - | |
523 | | - | |
524 | | - | |
525 | | - | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
535 | 513 | | |
536 | 514 | | |
537 | 515 | | |
538 | | - | |
| 516 | + | |
539 | 517 | | |
540 | 518 | | |
541 | 519 | | |
| |||
572 | 550 | | |
573 | 551 | | |
574 | 552 | | |
| 553 | + | |
| 554 | + | |
575 | 555 | | |
576 | 556 | | |
577 | 557 | | |
| |||
635 | 615 | | |
636 | 616 | | |
637 | 617 | | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
638 | 643 | | |
639 | 644 | | |
640 | 645 | | |
| |||
832 | 837 | | |
833 | 838 | | |
834 | 839 | | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
835 | 844 | | |
836 | 845 | | |
837 | 846 | | |
| |||
849 | 858 | | |
850 | 859 | | |
851 | 860 | | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
852 | 879 | | |
853 | 880 | | |
854 | 881 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
50 | 57 | | |
51 | 58 | | |
52 | 59 | | |
| |||
96 | 103 | | |
97 | 104 | | |
98 | 105 | | |
99 | | - | |
| 106 | + | |
| 107 | + | |
100 | 108 | | |
101 | 109 | | |
102 | 110 | | |
| |||
109 | 117 | | |
110 | 118 | | |
111 | 119 | | |
112 | | - | |
| 120 | + | |
113 | 121 | | |
114 | 122 | | |
115 | 123 | | |
| |||
118 | 126 | | |
119 | 127 | | |
120 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
121 | 144 | | |
122 | 145 | | |
123 | 146 | | |
124 | | - | |
| 147 | + | |
125 | 148 | | |
126 | 149 | | |
127 | 150 | | |
128 | 151 | | |
| 152 | + | |
129 | 153 | | |
130 | 154 | | |
131 | 155 | | |
| |||
145 | 169 | | |
146 | 170 | | |
147 | 171 | | |
148 | | - | |
| 172 | + | |
149 | 173 | | |
150 | 174 | | |
151 | 175 | | |
| |||
254 | 278 | | |
255 | 279 | | |
256 | 280 | | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | 281 | | |
335 | 282 | | |
336 | 283 | | |
337 | | - | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
338 | 297 | | |
339 | 298 | | |
340 | 299 | | |
| |||
505 | 464 | | |
506 | 465 | | |
507 | 466 | | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
0 commit comments