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

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

Open
ff137 opened this issue Nov 5, 2024 · 0 comments · May be fixed by #3362
Open
Assignees

Comments

@ff137
Copy link
Contributor

ff137 commented Nov 5, 2024

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.

Edit:
The exception associated with the runtime warning appears to be a red herring - it just depends on what task was running concurrently. This RuntimeWarning seems to only appear on DataDog. So, as far as I can tell, the coroutine .. was never awaited issue would usually occur silently, but due to DataDog / ddtrace injection, it picks up on it.

I have a fix for this, but I'll try include some before/after testing to validate that the fix is really necessary.

@ff137 ff137 self-assigned this Nov 5, 2024
ff137 added a commit to didx-xyz/acapy that referenced this issue Dec 2, 2024
@ff137 ff137 linked a pull request Dec 2, 2024 that will close this issue
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 a pull request may close this issue.

1 participant