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

Problems with python throws #79

Closed
guidiego opened this issue Oct 11, 2017 · 7 comments
Closed

Problems with python throws #79

guidiego opened this issue Oct 11, 2017 · 7 comments
Assignees
Labels

Comments

@guidiego
Copy link
Contributor

Whats happen?

For any reason python does not throw any exception during bottery run

How reproduce it?

In my case I'm testing some stuff that I've done in this PR: #78, so you can jump on my branch and do this steps:

  • Guarantee that bottery are local pip install -e ../bottery/path
  • Jump to my PR (or go to any function and force a error)
  • You will se that bottery still running without alerts or logs
@rougeth
Copy link
Owner

rougeth commented Oct 11, 2017

@IvanBrasilico got the same issue, I'll work on this one as soon as possible.

@rougeth rougeth added the bug label Oct 11, 2017
@rougeth rougeth self-assigned this Oct 11, 2017
@rougeth
Copy link
Owner

rougeth commented Oct 11, 2017

It seems to be bigger then I thought: python/asyncio#397.

@mawkee have you ever got in this issue?

@ElSaico
Copy link
Contributor

ElSaico commented Oct 12, 2017

I'm facing this as well - and, sadly enough, the solutions presented don't seem to work...

@rougeth
Copy link
Owner

rougeth commented Oct 13, 2017

I couldn't reproduce the same issue in a simpler example. A raise on both main and subtask will print the error:

import asyncio

async def subtask():
    print('subtask')
    # raise

async def main():
    print('main')
    # raise
    await asyncio.gather(subtask())
    await main()

loop = asyncio.get_event_loop()
loop.create_task(main())
loop.run_forever()

Running this example:

❯ python example.py
main
subtask
Task exception was never retrieved
future: <Task finished coro=<main() done, defined at async.py:8> exception=RuntimeError('No active exception to reraise',)>
Traceback (most recent call last):
  File "~/.pyenv/versions/3.5-dev/lib/python3.5/asyncio/tasks.py", line 242, in _step
    result = coro.throw(exc)
  File "async.py", line 10, in main
    await asyncio.gather(subtask())
  File "~/.pyenv/versions/3.5-dev/lib/python3.5/asyncio/futures.py", line 381, in __iter__
    yield self  # This tells Task to wait for completion.
  File "~/.pyenv/versions/3.5-dev/lib/python3.5/asyncio/tasks.py", line 310, in _wakeup
    future.result()
  File "~/.pyenv/versions/3.5-dev/lib/python3.5/asyncio/futures.py", line 294, in result
    raise self._exception
  File "~/.pyenv/versions/3.5-dev/lib/python3.5/asyncio/tasks.py", line 240, in _step
    result = coro.send(None)
  File "async.py", line 6, in subtask
    raise

But in a view, if I do something like this, bottery won't show the error:

def pong(message):
    raise

@IvanBrasilico
Copy link

Maybe the views must be assyncronous functions too.

@rougeth
Copy link
Owner

rougeth commented Oct 13, 2017

Dear friends, the problem was in the logger settings :/ Sorry for that hahahaha

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

No branches or pull requests

4 participants