openwallet-foundation / acapy

ACA-Py is a foundation for building decentralized identity applications and services running in non-mobile environments.
https://aca-py.org
Apache License 2.0
419 stars 512 forks source link

🐛 `RuntimeWarning: coroutine 'IndyVdrLedgerPool.context_close.<locals>.closer' was never awaited` #3328

Open ff137 opened 2 weeks ago

ff137 commented 2 weeks ago

When operating under load, the following RuntimeWarning gets generated in our logs:

RuntimeWarning: coroutine 'IndyVdrLedgerPool.context_close.<locals>.closer' was never awaited

As far as I can tell, this likely occurs when IndyVdrLedgerPool's async close task gets garbage collected. Or, perhaps the background task gets created too many times when acapy is under load, and doesn't always get scheduled properly. It's not yet clear why it occurs. And it doesn't appear to cause any other issues, but it's worth investigating, as the code might be behaving in unexpected ways.

The issue can also manifest as:

Exception ignored in: <coroutine object IndyVdrLedgerPool.context_close.<locals>.closer at 0x7ff607befe20>
Traceback (most recent call last):
File "<string>", line 1, in <lambda>
KeyError: '__import__'

I can't really tell what's going on here, but wanted to record it so long as we're debugging a fix.