diff --git a/ddtrace/appsec/_handlers.py b/ddtrace/appsec/_handlers.py index 43dc1a0216d..806e787cf93 100644 --- a/ddtrace/appsec/_handlers.py +++ b/ddtrace/appsec/_handlers.py @@ -1,4 +1,3 @@ -import asyncio import io import json from typing import Any @@ -171,6 +170,9 @@ def _on_lambda_parse_body( async def _on_asgi_request_parse_body(receive, headers): if asm_config._asm_enabled: + # This must not be imported globally due to 3rd party patching timeline + import asyncio + more_body = True body_parts = [] try: diff --git a/releasenotes/notes/asyncio_fix-d279a20c05a2bf24.yaml b/releasenotes/notes/asyncio_fix-d279a20c05a2bf24.yaml new file mode 100644 index 00000000000..7c970ed258e --- /dev/null +++ b/releasenotes/notes/asyncio_fix-d279a20c05a2bf24.yaml @@ -0,0 +1,4 @@ +--- +fixes: + - | + AAP: This fix resolves an issue where stream endpoints with daphne/django where unresponsive due to an asyncio error.