From 7c82fe7389e0e50719a300682260684a997bd263 Mon Sep 17 00:00:00 2001 From: Justin Santa Barbara Date: Thu, 10 Mar 2016 06:54:18 -0500 Subject: [PATCH] AWS: Increase timeout deleting ELB; log remaining security groups Either ELB is slow to delete (in which case the bumped timeout will help), or the security groups are otherwise blocked (in which case logging them will help us track this down). Fix #17626 --- pkg/cloudprovider/providers/aws/aws.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pkg/cloudprovider/providers/aws/aws.go b/pkg/cloudprovider/providers/aws/aws.go index 5ba3091486a..abec78add3c 100644 --- a/pkg/cloudprovider/providers/aws/aws.go +++ b/pkg/cloudprovider/providers/aws/aws.go @@ -2510,7 +2510,7 @@ func (s *AWSCloud) EnsureLoadBalancerDeleted(name, region string) error { } // Loop through and try to delete them - timeoutAt := time.Now().Add(time.Second * 300) + timeoutAt := time.Now().Add(time.Second * 600) for { for securityGroupID := range securityGroupIDs { request := &ec2.DeleteSecurityGroupInput{} @@ -2538,12 +2538,17 @@ func (s *AWSCloud) EnsureLoadBalancerDeleted(name, region string) error { } if time.Now().After(timeoutAt) { - return fmt.Errorf("timed out waiting for load-balancer deletion: %s", name) + ids := []string{} + for id := range securityGroupIDs { + ids = append(ids, id) + } + + return fmt.Errorf("timed out deleting ELB: %s. Could not delete security groups %v", name, strings.Join(ids, ",")) } glog.V(2).Info("Waiting for load-balancer to delete so we can delete security groups: ", name) - time.Sleep(5 * time.Second) + time.Sleep(10 * time.Second) } }