Repository navigation
Commit 0bcc7eb
[low] fix(usage): only clear the in-flight lock this render wrote (#624)
* fix(usage): only clear the in-flight lock this render wrote
A successful fetch removed usage.lock unconditionally. When two renders
fetch concurrently and one receives a 429, the other's later success
deleted the Retry-After lock, so the next render after the 180s cache
expiry fetched again inside the server's backoff window.
Clear the lock only while it still holds this render's own in-flight
record.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(usage): keep a rate-limit lock written during an in-flight fetch
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>1 parent 475e401 commit 0bcc7eb
2 files changed
Lines changed: 54 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
106 | 113 | | |
107 | 114 | | |
108 | 115 | | |
| |||
226 | 233 | | |
227 | 234 | | |
228 | 235 | | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
229 | 240 | | |
230 | 241 | | |
231 | 242 | | |
| |||
891 | 902 | | |
892 | 903 | | |
893 | 904 | | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
894 | 934 | | |
895 | 935 | | |
896 | 936 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
670 | 670 | | |
671 | 671 | | |
672 | 672 | | |
673 | | - | |
| 673 | + | |
| 674 | + | |
674 | 675 | | |
675 | 676 | | |
676 | | - | |
| 677 | + | |
677 | 678 | | |
678 | 679 | | |
679 | 680 | | |
| 681 | + | |
680 | 682 | | |
681 | 683 | | |
682 | | - | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
683 | 689 | | |
684 | | - | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
685 | 693 | | |
686 | 694 | | |
687 | 695 | | |
| |||
896 | 904 | | |
897 | 905 | | |
898 | 906 | | |
899 | | - | |
| 907 | + | |
900 | 908 | | |
901 | 909 | | |
902 | 910 | | |
| |||
935 | 943 | | |
936 | 944 | | |
937 | 945 | | |
938 | | - | |
| 946 | + | |
939 | 947 | | |
940 | 948 | | |
941 | 949 | | |
| |||
0 commit comments