-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wait for newly created services to stabilize. #878
Conversation
@@ -117,7 +118,17 @@ func (p *ECSServiceResource) create(properties *ECSServiceProperties) (string, e | |||
return "", fmt.Errorf("error creating service: %v", err) | |||
} | |||
|
|||
return *resp.Service.ServiceArn, nil | |||
arn := resp.Service.ServiceArn | |||
if err := p.ecs.WaitUntilServicesStable(&ecs.DescribeServicesInput{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May want to also set a hard timeout on this. Like 5-10 minutes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out, the waiter will check up to 40 times, with a 15 second delay between checks, so this will wait up to 10 minutes, which seems about right.
👍 |
Since this can potentially block the sqs polling loop, provisioning should happen in a goroutine. |
Ok, made some changes to this after testing in my environment:
I'll test this in a staging environment tomorrow and make sure that swapping over to |
This is working well in staging. Gonna merge. |
I think it might be good to wait for services to stabilize only when they're being created. Couple reasons: