-
Notifications
You must be signed in to change notification settings - Fork 18
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
TCPEchoServer: abort the transport on connection lost #1582
TCPEchoServer: abort the transport on connection lost #1582
Conversation
…rceWarnings and write() exceptions during tearDown() of SSL tests
I have run system_tests_tcp_conns_terminate.py more times and I managed to hit the write() exception again in the tearDown() when the wait() is called for the SSL enabled TCPEchoServers. So this PR helps to avoid the ResourceWarning messages but the write() exception still happens sporadically.
|
TL;DR - we should land this fix since there's really no better alternative. The problem is that there doesn't appear to be a way to cleanly shutdown the asyncio.Server. And by "cleanly" I specifically mean closing currently open client sockets and reclaiming resources. See the above cpython issue, I'm pretty sure that's the root of that problem. The other thing to consider is that maybe the way we terminate the server is wrong: skupper-router/tests/TCP_echo_server.py Line 223 in 9211296
What we're trying to implement is a way to stop the Server from another thread via calling the wait() method. I'm not sure the _cancel_server() code is the right way of doing this. I seem to recall hacking at this for awhile since I could not find a clear explaination of how this should be done on the Python docs. If there's anyone out there that actually understands the nuances of running an asyncio.Server asynchronously from the test I'm open to suggestions! |
@gabordozsa Do you have commit rights to the skupper-router github repo ? If not, I will ask @ted-ross or Andy Smith to give you commit rights. |
@ganeshmurthy No, I do not have write access yet. |
I have emailed @ted-ross and Andy Smith to give you commit rights for skupper-router github repo. I will keep you posted. |
@gabordozsa I will commit this PR to main. |
This is to avoid potential ReseourceWarnings and write() exceptions during tearDown() of SSL tests. I hit this with system_tests_tcp_conns_terminate.py but I think it can happen in any other test which uses the echo client with SSL. Example warning :