You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use Int64.random instead of .randomElement in HTTPConnectionPool.calculateBackoff
Motivation:
On 32-bit systems, using .randomElement on a range larger than what can fit in Int32 causes a crash. After only 26 or 27 retries of a request using HTTPClient, the calculateBackoff method would run into this and crash consistently on an armv7 (32-bit) device.
Modifications:
A one-line fix to opt to using Int64.random on the same jitterRange instead of .randomElement, which works as expected without crashing on 32-bit systems.
Result:
The HTTPClient now works as expected and can perform as many retries as needed without crashing.
0 commit comments