Document waiter.config objects
Currently the boto3 documentation fails to mention the config attribute of waiter objects. This is frustrating for newcomers, as the only way to customize the retry count and delay time for waiters is through these configuration objects.
Usually if we do not document something, we do not really want users try to use those features, but in this case, I think I would be fine with documenting the waiter configs, assuming we want to make the claim that the interface is public and will not break or a better option would be exposing the configuration options as a parameter to get_waiter(). Marking as feature request nonetheless.
What is the way to deal with timeouts? I have a script in boto3 that creates a snapshot, waits for it to complete and then deletes the volume. It just timed out with a 15GB drive. Now I have to manually delete the volume and other cleanup. Surely there is a better way. Is this config documented somewhere?
I'm having issues with this also, I'm trying to extend delays/maxAttempts when making modifications to an RDS instance and experiencing timeouts, would be great if changes to config were exposed/documented.
Either the config objects should be documented, or a different public interface should be built and documented, as the whole point of waiters is to wait until something is "done", and the miniscule timeouts/max-retries for RDS-related operations (such as snapshots or replica spin-ups) make waiter objects pretty useless for anything real-world. It's bad enough to have to renew assumed role credentials for longer running operations.
Try something like that:
ec2.get_waiter('image_available')
wait_ami = ec2.get_waiter('image_available')
wait_ami.wait(ImageIds=[ami_id],WaiterConfig={'Delay': 10,'MaxAttempts': 40})
Isn't EMR.Waiter.StepComplete.wait an example of how to configure the attempts number and the delay?
Isn't EMR.Waiter.StepComplete.wait an example of how to configure the attempts number and the delay?
Looks like the cat's out of the bag, as @drorata points out. It's over 3 years since this was reported. Sounds like the interface is public and should be documented. https://tomcudd.com/devops-culture-anti-pattern-tribal-knowledge/
Possibly, related. I have a use case where I create an AMI using an ec2 instance, so the user_data for the instance shuts down the instance as soon as it is set up. Ideally, I'd like to just wait for the instance to reach the "Stopped" state. However, wait_for_stop considers "Pending" a failed state (not really sure why). So they best I've been able to come up with, using the documented API is:
instance.wait_until_running()
instance.wait_until_stopped()
but this has a race condition, where if we go from "Pending" to "Stopping" between two check in instance.wait_until_running(), then it will throw an exception.
See #176