From 456fbd2f776845d92c2899bb5fef61d688f49244 Mon Sep 17 00:00:00 2001 From: kv Date: Thu, 20 May 2021 17:33:04 +0800 Subject: [PATCH] fix: remove upstream which is ref by multi-routes cause retry (#472) --- pkg/apisix/cluster.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/apisix/cluster.go b/pkg/apisix/cluster.go index 36b5f3d981..846a17aac7 100644 --- a/pkg/apisix/cluster.go +++ b/pkg/apisix/cluster.go @@ -418,7 +418,11 @@ func (c *cluster) deleteResource(ctx context.Context, url string) error { if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusNoContent && resp.StatusCode != http.StatusNotFound { err = multierr.Append(err, fmt.Errorf("unexpected status code %d", resp.StatusCode)) - err = multierr.Append(err, fmt.Errorf("error message: %s", readBody(resp.Body, url))) + message := readBody(resp.Body, url) + err = multierr.Append(err, fmt.Errorf("error message: %s", message)) + if strings.Contains(message, "still using") { + return cache.ErrStillInUse + } return err } return nil