AppScale / appscale-tools

A set of command-line tools that can be used to interact with AppScale.
Other
51 stars 49 forks source link

Error handling for azure agent autoscaling #674

Closed whoarethebritons closed 6 years ago

whoarethebritons commented 6 years ago

This branch is a result of issues we have noticed with autoscaling in Azure on master. It attempts to cover the following cases:

run_and_return_exception, raise_if_error, and convert_to_list are meant to address these issues so that we can capture the CloudError that is thrown and return it if we're running within a thread or raise it if we are not running within a thread. Any errors captured in threads are raised after the joins so that the caller can handle the AgentRuntimeException

This branch requires a change on the appscale side as well so that the InfrastructureManager can handle the AgentRuntimeException and also base_agent is modified here so it could be removed to remove confusion about that exception. I'm working on unit tests for the appscale side so that will be up shortly.

I'd like to get reviews before posting the demo in case I have to rerun it but I have a demo ready.

cdonati commented 6 years ago

@whoarethebritons Sorry, but I am not a fan of the run_and_return_exception, raise_if_error pattern you are using here. It's essentially equivalent to a bare except, which will catch even more than except Exception (see https://www.python.org/dev/peps/pep-0008/#programming-recommendations, "When catching exceptions...").

I also don't see a reason to avoid using try/except.

whoarethebritons commented 6 years ago

@cdonati ok, I'm going to close this PR then and make a new branch for it.