We occasionally get HTTP/504 responses from AWS for no obvious reason, i.e. there's no clear source of extraordinary load on the underlying service. In theory, HTTP/503 and HTTP/429 might also merit retrying after a delay. HTTP technically supports a Retry-After header, as well.
Normally none of this matters much since these responses currently feel rare/sporadic, but the reliability of bin/host upload for very large files (e.g., MySQL dumps) is materially impacted (I just had a 7GB upload hit a 504 and abort, cleaning up the underlying temporary file).
ArcanistFileUploader should retry failed parts, and treat 504 as a retryable failure.