furious icon indicating copy to clipboard operation
furious copied to clipboard

Exception setting Async.result.

Open andreleblanc-wf opened this issue 10 years ago • 1 comments

When attempting to set the .result of an async, if async.executing is True, the call to .executing = True will raise an exception. That exception is caught in the final except clause, which attempts to set the result to an exception, which raises another exception because the Task isn't executing.

The relevant code starts here: https://github.com/Workiva/furious/blob/master/furious/processors.py#L56

The solution would probably involve explicitly catching the NotExecutingError and doing something other than attempt to write it to the Async.result.

from https://jira.atl.workiva.net/browse/DS-3936

Traceback (most recent call last):
  File "third_party/webapp2-2.5.2/webapp2.py", line 1535, in __call__
    rv = self.handle_exception(request, response, e)
  File "third_party/webapp2-2.5.2/webapp2.py", line 1529, in __call__
    rv = self.router.dispatch(request, response)
  File "third_party/webapp2-2.5.2/webapp2.py", line 1278, in default_dispatcher
    return route.handler_adapter(request, response)
  File "third_party/webapp2-2.5.2/webapp2.py", line 1102, in __call__
    return handler.dispatch()
  File "third_party/webapp2-2.5.2/webapp2.py", line 572, in dispatch
    return self.handle_exception(e, self.app.debug)
  File "third_party/webapp2-2.5.2/webapp2.py", line 570, in dispatch
    return method(*args, **kwargs)
  File "external_libs/furious/handlers/webapp.py", line 28, in post
    self._handle_task()
  File "external_libs/furious/handlers/webapp.py", line 37, in _handle_task
    headers, self.request.body)
  File "external_libs/furious/handlers/__init__.py", line 38, in process_async_task
    run_job()
  File "external_libs/furious/processors.py", line 72, in run_job
    status=AsyncResult.ERROR)
  File "external_libs/furious/async.py", line 160, in result
    'The Async must be executing to set its result.')
NotExecutingError
NotExecutingError: The Async must be executing to set its result.

andreleblanc-wf avatar Jul 28 '15 18:07 andreleblanc-wf

Andre, I also noticed while working on some stuff and am going to try and resolve it in my PR

rosshendrickson-wf avatar Aug 25 '15 13:08 rosshendrickson-wf