Repository navigation
Commit bbb516b
fix(transport): Keep the longest active rate limit
A shorter rate limit replaced a longer one that was still active, both for repeated categories in one X-Sentry-Rate-Limits header and across responses, including the all-categories limit set by a 429. The SDK then sent that category before the longer quota expired.
The deadlines are now stored in a private _RateLimits class. Its only write operation, update, keeps the later of the stored and the new deadline, so no update path can shorten an active limit. The backing dict is name-mangled and the class uses __slots__.
Fixes #8296
Co-Authored-By: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com>1 parent e540bd6 commit bbb516b
2 files changed
Lines changed: 66 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
214 | 243 | | |
215 | 244 | | |
216 | 245 | | |
| |||
224 | 253 | | |
225 | 254 | | |
226 | 255 | | |
227 | | - | |
| 256 | + | |
228 | 257 | | |
229 | 258 | | |
230 | 259 | | |
| |||
343 | 372 | | |
344 | 373 | | |
345 | 374 | | |
346 | | - | |
| 375 | + | |
| 376 | + | |
347 | 377 | | |
348 | 378 | | |
349 | 379 | | |
| |||
356 | 386 | | |
357 | 387 | | |
358 | 388 | | |
359 | | - | |
360 | | - | |
| 389 | + | |
| 390 | + | |
361 | 391 | | |
362 | 392 | | |
363 | 393 | | |
| |||
463 | 493 | | |
464 | 494 | | |
465 | 495 | | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
| 496 | + | |
| 497 | + | |
471 | 498 | | |
472 | 499 | | |
473 | | - | |
474 | | - | |
475 | | - | |
| 500 | + | |
476 | 501 | | |
477 | 502 | | |
478 | 503 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
473 | 474 | | |
474 | 475 | | |
475 | 476 | | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
476 | 493 | | |
477 | 494 | | |
478 | 495 | | |
| |||
511 | 528 | | |
512 | 529 | | |
513 | 530 | | |
514 | | - | |
| 531 | + | |
515 | 532 | | |
516 | 533 | | |
517 | 534 | | |
| |||
547 | 564 | | |
548 | 565 | | |
549 | 566 | | |
550 | | - | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
551 | 570 | | |
552 | 571 | | |
553 | 572 | | |
| |||
600 | 619 | | |
601 | 620 | | |
602 | 621 | | |
603 | | - | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
604 | 626 | | |
605 | 627 | | |
606 | 628 | | |
| |||
694 | 716 | | |
695 | 717 | | |
696 | 718 | | |
697 | | - | |
| 719 | + | |
698 | 720 | | |
699 | 721 | | |
700 | 722 | | |
| |||
826 | 848 | | |
827 | 849 | | |
828 | 850 | | |
829 | | - | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
830 | 854 | | |
831 | 855 | | |
832 | 856 | | |
| |||
0 commit comments