Skip to content
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

Better error reporting in case a computation fails #101

Closed
azawlocki opened this issue Oct 21, 2020 · 0 comments · Fixed by #102
Closed

Better error reporting in case a computation fails #101

azawlocki opened this issue Oct 21, 2020 · 0 comments · Fixed by #102
Assignees

Comments

@azawlocki
Copy link
Contributor

Currently it may look as follows (in the DEBUG log):

[2020-10-21 00:10:53,497 DEBUG yapapi.runner] ComputationFailed(reason='ApiException()')
[2020-10-21 00:10:53,497 ERROR yapapi.summary] Computation failed, reason: ApiException()

This is because we use __repr__() function on the exception that causes the failure. In case of ApiException(), __str__() would give us more useful information (but for certain other exceptions,
__str__() returns just the empty string).

Moreover, we don't store the exception info with ComputationFailed event.

Compare with how worker errors are reported:

[2020-10-21 15:07:28,698 DEBUG yapapi.executor] WorkerFinished(agr_id='241d4b5f768d226c5a6a06b2650b22826053fdb43ed0e060d09664527215e311', exc_info=(<class 'yapapi.rest.activity.CommandExecutionError'>, CommandExecutionError('stderr: Local service error: Transfer error: IO error: No such file or directory (os error 2)', 5), <traceback object at 0x7f5e65c36910>))
Traceback (most recent call last):
  File "/home/azawlocki/golem/yagna-integration/yapapi/yapapi/executor/__init__.py", line 354, in start_worker
    await command_generator.athrow(*sys.exc_info())
  File "examples/blender/blender.py", line 50, in worker
    yield ctx.commit()
  File "/home/azawlocki/golem/yagna-integration/yapapi/yapapi/executor/__init__.py", line 322, in start_worker
    async for step in remote:
  File "/home/azawlocki/golem/yagna-integration/yapapi/yapapi/rest/activity.py", line 137, in __aiter__
    raise CommandExecutionError(result.message, last_idx)
yapapi.rest.activity.CommandExecutionError: ('stderr: Local service error: Transfer error: IO error: No such file or directory (os error 2)', 5)

This is possible since the WorkerFinished event stores the whole traceback. We should use similar mechanism when reporting computation failures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant