Closed whoarethebritons closed 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.
@cdonati ok, I'm going to close this PR then and make a new branch for it.
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
, andconvert_to_list
are meant to address these issues so that we can capture theCloudError
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 theAgentRuntimeException
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.