fix: remove upstream which is ref by multi-routes cause retry (#472)
diff --git a/pkg/apisix/cluster.go b/pkg/apisix/cluster.go
index 36b5f3d..846a17a 100644
--- a/pkg/apisix/cluster.go
+++ b/pkg/apisix/cluster.go
@@ -418,7 +418,11 @@
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