Skip to content

Commit 49caf9f

Browse files
committed
Release 0.5.1
1 parent 3d87490 commit 49caf9f

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Enhancements
66
- Add basic rate limiting retries to the FlyBackend to abide by Fly's rate limits of 1 request per second, with 3 requests per second burst.
7+
- Add basic retries for `no capacity` errors in the FlyBackend
78

89
## 0.5.0 (2024-09-11)
910

lib/flame/fly_backend.ex

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,11 @@ defmodule FLAME.FlyBackend do
364364
{:ok, {{_, 200, _}, _, response_body}} ->
365365
JSON.decode!(response_body)
366366

367-
{:ok, {{_, 429, _}, _, _response_body}} when remaining_tries > 0 ->
367+
# 429 Too Many Requests (rate limited)
368+
# 412 Precondition Failed (can't find capacity)
369+
# 409 Conflict (the flyd tried ending up not having capacity)
370+
# 422 Unprocessable Entity (could not find capcity for volume workloads)
371+
{:ok, {{_, status, _}, _, _response_body}} when status in [429, 412, 409, 422] and remaining_tries > 0 ->
368372
Process.sleep(1000)
369373
http_post!(url, remaining_tries - 1, opts)
370374

0 commit comments

Comments
 (0)