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

exceptions not set on pending futures #109

Open
hartytp opened this issue May 7, 2019 · 0 comments
Open

exceptions not set on pending futures #109

hartytp opened this issue May 7, 2019 · 0 comments

Comments

@hartytp
Copy link

hartytp commented May 7, 2019

The following code snippet should tries to connect to a server that doesn't exist

host = "127.0.0.1"
port = 5000

try:
    print("connecting...")   
    loop = asyncio.get_event_loop()
    loop.run_until_complete(asyncio.open_connection(host, port))
except Exception as e:
    print("exception" , e)
print("done")

Expected behaviour is that a ConnectionRefusedError is raised. Without Quamash, that is what happens. With quamash, run_until_complete never finishes and the following warning is printed

WARNING<7>:quamash._QEventLoop:Event callback failed
Traceback (most recent call last):
  File "c:\scratch\quamash\quamash\_windows.py", line 42, in _process_events
    value = callback(transferred, key, ov)
  File "C:\Users\localadmin\Anaconda3\envs\artiq-env\lib\asyncio\windows_events.py", line 509, in finish_connect
    ov.getresult()
ConnectionRefusedError: [WinError 1225] The remote computer refused the network connection

It looks like the future gets stuck in the PENDING state. I believe this is related to e5fc6b1

Changing this to

except OSError as e:
    self._logger.warning('Event callback failed', exc_info=sys.exc_info())
    if not f.done():
        f.set_exception(e)

seems to resolve the issue. Thoughts?

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

No branches or pull requests

1 participant