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

cleanup on asyncio.CancelledError #110

Closed
NovapaX opened this issue Nov 14, 2017 · 2 comments
Closed

cleanup on asyncio.CancelledError #110

NovapaX opened this issue Nov 14, 2017 · 2 comments

Comments

@NovapaX
Copy link
Contributor

NovapaX commented Nov 14, 2017

I'm putting some api calls in a async_timeout, because aiocoap has a 1+ minute timeout by default.

But pytradfri doesn't cleanup on a asyncio.CancelledError.
I think it should.

The place to add such thing would be here right?
https://github.com/ggravlingen/pytradfri/blob/b4a0ee2210d6a5643bffc40829e6f093a1dbc796/pytradfri/api/aiocoap_api.py#L99-L102

        except asyncio.CancelledError as e:
            yield from self._reset_protocol(e)
            raise e

If so I would be glad to make a pull request.

@lwis
Copy link
Collaborator

lwis commented Nov 14, 2017

That's fine, async_timeout would be handy as the Gateway should respond in less than a minute.

@NovapaX
Copy link
Contributor Author

NovapaX commented Nov 14, 2017

Putting things in a async_timout can also be used as a workaround for some aiocoap issues.
(for example not properly cancelling the exchange on a fatal DTLS error. Instead is lets the exchange timeout while outputting a lot of error messages.)

@lwis lwis closed this as completed Nov 14, 2017
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

2 participants