Skip to content

Commit

Permalink
tests: googleapi error 504
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Aizman <[email protected]>
  • Loading branch information
alex-aizman committed Sep 1, 2023
1 parent 842a514 commit 542574c
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions ais/test/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -451,16 +451,30 @@ func (m *ioContext) del(opts ...int) {
defer wg.Done()
err := api.DeleteObject(baseParams, m.bck, obj.Name)
if err != nil {
e := strings.ToLower(err.Error())
switch {
case cmn.IsErrObjNought(err):
err = nil
case strings.Contains(err.Error(), "server closed idle connection"):
case strings.Contains(e, "server closed idle connection"):
// see (unexported) http.exportErrServerClosedIdle in the Go source
err = nil
case strings.Contains(err.Error(), "try again"):
case strings.Contains(e, "try again"):
// aws-error[InternalError: We encountered an internal error. Please try again.]
// retry once
time.Sleep(time.Second)
err = api.DeleteObject(baseParams, m.bck, obj.Name)
case m.bck.IsCloud() && apc.ToScheme(m.bck.Provider) == apc.GSScheme &&
strings.Contains(e, "gateway") && strings.Contains(e, "timeout"):
// e.g:. "googleapi: Error 504: , gatewayTimeout" (where the gateway is in fact LB)
// retry once
time.Sleep(2 * time.Second)
err = api.DeleteObject(baseParams, m.bck, obj.Name)
if err != nil {
if errCnt.Load() < 5 {
tlog.Logf("Warning: failed to cleanup %s: %v\n", m.bck.Cname(""), err)
}
err = nil
}
case cos.IsErrConnectionNotAvail(err):
errCnt.Add(maxErrCount / 10)
default:
Expand Down

0 comments on commit 542574c

Please sign in to comment.