Skip to content

Conversation

@stepansergeevitch
Copy link
Contributor

Apparently, I've finally managed to investigate the issue with RuntimeWarning: coroutine 'BaseConnection._aclose' was never awaited in tests.
It seems like connection.__del__ function (which inside calls asynchronous _aclose in global event loop) sometimes gets called after the event loop is closed (because it's called by the garbage collector in background). To fix this, added a custom loop for connection to use it for closing. I assume this issue could happen in real environments too.

@stepansergeevitch stepansergeevitch self-assigned this Dec 3, 2021
@stepansergeevitch stepansergeevitch changed the title add custom loop for connection __del__ fix: add custom loop for connection __del__ Dec 3, 2021
@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 6, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@stepansergeevitch stepansergeevitch merged commit cadd629 into main Dec 6, 2021
@stepansergeevitch stepansergeevitch deleted the connection_loop branch December 6, 2021 10:05
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.

3 participants