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

add timeouts to connections, reading & writing sockets etc #116

Closed
komuw opened this issue May 29, 2019 · 3 comments · Fixed by #113
Closed

add timeouts to connections, reading & writing sockets etc #116

komuw opened this issue May 29, 2019 · 3 comments · Fixed by #113
Labels
bug Something isn't working

Comments

@komuw
Copy link
Owner

komuw commented May 29, 2019

check vumi timeouts and use those; https://buildmedia.readthedocs.org/media/pdf/vumi/latest/vumi.pdf

@komuw komuw added the bug Something isn't working label May 29, 2019
@komuw
Copy link
Owner Author

komuw commented May 29, 2019

  • also add timeouts to all the calls to user BYO stuff like; brokers, hooks etc

@komuw
Copy link
Owner Author

komuw commented May 29, 2019

the client.writer and client.reader should not have timeouts since they are non-blocking sockets.

print(self.writer.transport.get_extra_info('socket').gettimeout())
0.0

From [1]; If zero is given, the socket is put in non-blocking mode.

  1. https://docs.python.org/3.6/library/socket.html#socket.socket.settimeout

@komuw
Copy link
Owner Author

komuw commented May 29, 2019

also add timeouts to all the calls to user BYO stuff like; brokers, hooks etc

opened a new issue for this in #119

@komuw komuw mentioned this issue May 31, 2019
komuw added a commit that referenced this issue May 31, 2019
What:
- Introduce a configurable timeout when trying to connect to SMSC
- Try and detect when the connection to SMSC is disconnected and attempt to re-connect & re-bind
- bugfix; `asyncio.streams.StreamWriter.drain` should not be called concurrently by multiple coroutines[1]
- when shutting down, `naz` now tries to make sure that write buffers are properly flushed[2][3]

Why:
- Make `naz` more failure tolerant
- Fixes: #67
- Fixes: #114
- Fixes: #116
- Fixes: #117
- Fixes: #120

References:
1. https://bugs.python.org/issue29930
2. https://vorpus.org/blog/some-thoughts-on-asynchronous-api-design-in-a-post-asyncawait-world/
3. aio-libs/aiohttp#1369
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant