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

properly close connection pool and shutdown transport #90

Merged
merged 3 commits into from
Sep 1, 2024

Conversation

maurerle
Copy link
Collaborator

This is needed for wait_closed to terminate starting from 3.12 Before, wait_closed was a noop and did not check for all clients to be closed.

see python/cpython#104344

fixes #89

@maurerle
Copy link
Collaborator Author

Before, running pytest tests/unit_tests/container/test_tcp.py did not succeed in a python 3.12 environment.

As discussed in the cpython issue, I think the proper behavior is to close the TCP transport in any way when it is not used anymore.

Now, the tests for python 3.12 succeed as well, so I added this to the test suite.

@maurerle
Copy link
Collaborator Author

There was another deadlock which did shut down multiple containers correctly, as they have open connections to each other.
This was solved by using asyncio.gather instead of the for loop

Take a look here to see the successful actions run:
https://github.com/maurerle/mango/actions/runs/10633499632/job/29478695105

This is needed for wait_closed to terminate starting from 3.12
Before, wait_closed was a noop and did not check for all clients to be closed.

see python/cpython#104344
…rialized with awaits

This is needed as wait_closed now properly waits for all connections to be closed
@rcschrg rcschrg merged commit 1414303 into OFFIS-DAI:development Sep 1, 2024
@maurerle maurerle deleted the fix_connection_pool_closing branch September 1, 2024 22:11
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

Successfully merging this pull request may close these issues.

pytest does not work as tcp server does not terminate anymore
2 participants