Commit d38ca8c
committed
Close intermediate 429 responses before retry to prevent resource leaks
When a request receives a 429 rate limit response and the client
retries, the previous Response (and its underlying connection) was
not being closed. This could leak connections from the OkHttp
connection pool under sustained rate limiting. Close the response
body before sleeping and retrying.1 parent 526018f commit d38ca8c
1 file changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
321 | 325 | | |
322 | 326 | | |
323 | 327 | | |
| |||
0 commit comments