Commit adf4853
authored
feat(csharp): convert cloudfetch retry from limit by # of retries to limit by time (#375)
## Summary
- Replace fixed 3-attempt retry with **5-minute time-budget** approach
using exponential backoff with jitter (matching RetryHttpHandler's
pattern)
- Retry all exceptions (502 Bad Gateway from proxy, connection drops,
TCP resets, HttpClient.Timeout) — catch-all, not just transport errors
- Add new `adbc.databricks.cloudfetch.retry_timeout_seconds` parameter
(default 300s / 5 min)
- Keep `adbc.databricks.cloudfetch.max_retries` parameter for PowerBI
backward compatibility (default -1 = not set). When set, retry loop
exits if either max retries or timeout is reached first
- Add detailed retry tracing (attempt count, backoff delay, timeout
budget remaining)
### Problem
CloudFetch downloads used a fixed 3-retry loop with linear backoff
(~1.5s total). When a proxy returns 502 or a firewall blocks cloud
storage, all 3 retries exhaust within seconds — not enough time for
transient issues to resolve.
### Solution
Switch to a time-budget approach (same as RetryHttpHandler from #373):
keep retrying with exponential backoff + jitter until the 5-minute
budget is exhausted. This gives transient issues (proxy errors, firewall
rules, connection drops) enough time to resolve.
| | Before | After |
|---|---|---|
| Retry limit | 3 attempts | 5-minute time budget (+ optional
max_retries) |
| Backoff | Linear (500ms, 1s, 1.5s) | Exponential with jitter (500ms →
1s → 2s → ... → 32s cap) |
| Total retry window | ~3 seconds | Up to 5 minutes |
| Error classification | Retry all exceptions | Retry all exceptions
(same) |
| max_retries param | Required (default 3) | Optional (default -1 = not
set) |
## Test plan
- [x] All 9 CloudFetch downloader unit tests pass
- [x] Full build succeeds (netstandard2.0 + net8.0)
- [ ] Manual test: block cloud storage via MITM firewall, verify retries
continue for 5 min
- [ ] Manual test: unblock within 5 min, verify download resumes
successfully
This pull request was AI-assisted by Isaac.1 parent 38305b5 commit adf4853
File tree
4 files changed
+132
-35
lines changed- csharp
- src
- Reader/CloudFetch
- test/E2E/CloudFetch
4 files changed
+132
-35
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
60 | 68 | | |
61 | 69 | | |
62 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
62 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
63 | 66 | | |
64 | 67 | | |
65 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
66 | 75 | | |
67 | 76 | | |
68 | 77 | | |
| |||
116 | 125 | | |
117 | 126 | | |
118 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
119 | 142 | | |
120 | 143 | | |
121 | 144 | | |
| |||
124 | 147 | | |
125 | 148 | | |
126 | 149 | | |
127 | | - | |
| 150 | + | |
| 151 | + | |
128 | 152 | | |
129 | 153 | | |
130 | 154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| |||
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
| 98 | + | |
97 | 99 | | |
98 | 100 | | |
99 | 101 | | |
| |||
114 | 116 | | |
115 | 117 | | |
116 | 118 | | |
117 | | - | |
118 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
119 | 122 | | |
120 | 123 | | |
121 | 124 | | |
| |||
125 | 128 | | |
126 | 129 | | |
127 | 130 | | |
128 | | - | |
129 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
130 | 134 | | |
131 | 135 | | |
132 | 136 | | |
| |||
138 | 142 | | |
139 | 143 | | |
140 | 144 | | |
| 145 | + | |
141 | 146 | | |
142 | 147 | | |
143 | 148 | | |
| |||
486 | 491 | | |
487 | 492 | | |
488 | 493 | | |
489 | | - | |
490 | | - | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
491 | 505 | | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
492 | 519 | | |
493 | 520 | | |
494 | 521 | | |
| |||
562 | 589 | | |
563 | 590 | | |
564 | 591 | | |
565 | | - | |
| 592 | + | |
566 | 593 | | |
567 | | - | |
568 | | - | |
569 | | - | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
570 | 616 | | |
571 | | - | |
572 | | - | |
573 | | - | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
574 | 623 | | |
575 | 624 | | |
576 | | - | |
| 625 | + | |
| 626 | + | |
577 | 627 | | |
578 | 628 | | |
579 | 629 | | |
| |||
583 | 633 | | |
584 | 634 | | |
585 | 635 | | |
586 | | - | |
| 636 | + | |
| 637 | + | |
587 | 638 | | |
588 | 639 | | |
589 | 640 | | |
590 | 641 | | |
591 | 642 | | |
592 | | - | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
593 | 648 | | |
594 | 649 | | |
595 | 650 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
181 | | - | |
182 | | - | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
183 | 184 | | |
184 | 185 | | |
185 | 186 | | |
| |||
262 | 263 | | |
263 | 264 | | |
264 | 265 | | |
265 | | - | |
266 | | - | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
267 | 269 | | |
268 | 270 | | |
269 | 271 | | |
270 | 272 | | |
271 | 273 | | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | 274 | | |
276 | 275 | | |
277 | 276 | | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
278 | 286 | | |
279 | 287 | | |
| 288 | + | |
280 | 289 | | |
281 | | - | |
282 | | - | |
| 290 | + | |
283 | 291 | | |
284 | 292 | | |
285 | 293 | | |
| |||
351 | 359 | | |
352 | 360 | | |
353 | 361 | | |
354 | | - | |
355 | | - | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
356 | 365 | | |
357 | 366 | | |
358 | 367 | | |
| |||
365 | 374 | | |
366 | 375 | | |
367 | 376 | | |
368 | | - | |
| 377 | + | |
369 | 378 | | |
370 | 379 | | |
371 | 380 | | |
| |||
684 | 693 | | |
685 | 694 | | |
686 | 695 | | |
687 | | - | |
688 | | - | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
689 | 699 | | |
690 | 700 | | |
691 | 701 | | |
| |||
0 commit comments