This is still a bit rough. It currently retries regardless of the
error (however, with an exponential backoff and a limit so not that
big of an issue, at worst we waste some time retrying). We also print
the exception to stderr which is a bit nasty but useful for debugging.
I did verify in logs that we hit the retry code path and that things
seem to be properly cached.
I’ll clean this up & upstream this to Bazel once we have verified for
a few days/weeks that it works well for us.
Reviewing patch files is nasty so I recommend to take a look at the
branch in my Bazel fork instead
https://github.com/cocreature/bazel/tree/cache-retry.
changelog_begin
changelog_end