superfly / flyctl

Command line tools for fly.io services
https://fly.io
Apache License 2.0
1.36k stars 222 forks source link

Retry more flaps calls and classify errors better #3671

Open billyb2 opened 1 week ago

billyb2 commented 1 week ago

Change Summary

What and Why: Sorry, this is a two part PR:

  1. We're now retrying every flaps call where it seems relevant. I noticed in tracing that some builder creations were failing unnecessarily
  2. We're now catching more errors. For whatever reason, flaps can return "App not found" or "Could not find app" when it has an issue finding an app. We're doing string comparisons :vomit: to find both

How: I created a new function that retries flaps errors that are > 500 and < 600. There are likely other errors we can retry (408, for example)

Related to:


Documentation

rugwirobaker commented 1 week ago

Could the retry code be added to the client code itself? I think it would be more clean.

billyb2 commented 1 week ago

Could the retry code be added to the client code itself? I think it would be more clean.

yea that's a good idea