Commit c440cd5
authored
Use adaptive retry delay for transaction resolution (#100)
* Use adaptive retry delay for transaction resolution
Add transaction_hash_retry_delay(attempts) to compute exponential/backoff-style delays based on job.attempts(), and apply it when requeueing transaction-hash fetches. Replace hardcoded 1s/2s delays with the computed delay for both bundler errors (nack) and Pending responses (map_err_nack), and add tracing logs to record bundler_transaction_id, attempt, and retry_delay_seconds. This reduces aggressive retries and centralizes retry timing logic.
* Add tests for transaction_hash_retry_delay
Adds a unit test module verifying that transaction_hash_retry_delay respects bucket boundaries. The test checks edge cases around thresholds (5/6, 20/21, 100/101, 1000/1001) and ensures the function returns the expected Durations (2s, 10s, 30s, 5min, 30min) for those ranges.1 parent 3ede6ab commit c440cd5
1 file changed
Lines changed: 56 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
32 | 42 | | |
33 | 43 | | |
34 | 44 | | |
| |||
174 | 184 | | |
175 | 185 | | |
176 | 186 | | |
| 187 | + | |
177 | 188 | | |
178 | 189 | | |
179 | 190 | | |
| |||
214 | 225 | | |
215 | 226 | | |
216 | 227 | | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
217 | 234 | | |
218 | 235 | | |
219 | 236 | | |
220 | | - | |
| 237 | + | |
221 | 238 | | |
222 | 239 | | |
223 | 240 | | |
| |||
232 | 249 | | |
233 | 250 | | |
234 | 251 | | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
235 | 258 | | |
236 | 259 | | |
237 | 260 | | |
238 | | - | |
| 261 | + | |
239 | 262 | | |
240 | 263 | | |
241 | 264 | | |
| |||
384 | 407 | | |
385 | 408 | | |
386 | 409 | | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
0 commit comments