High workload issue "partially initialized module 'anyio._backends._asyncio' has no attribute 'checkpoint_if_cancelled'"
See original GitHub issueHey,
I notice some error are thrown sporadically with no reason
core.error_handler:log_error:18 - <class 'AttributeError'> - AttributeError("partially initialized module 'anyio._backends._asyncio' has no attribute 'checkpoint_if_cancelled' (most likely due to a circular import)")
Full stack trace
File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1568, in send
response = await self._send_handling_auth(
File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1604, in _send_handling_auth
response = await self._send_handling_redirects(
File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1640, in _send_handling_redirects
response = await self._send_single_request(request, timeout)
File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1681, in _send_single_request
) = await transport.handle_async_request(
File "/usr/local/lib/python3.9/site-packages/httpx_socks/_async_transport.py", line 60, in handle_async_request
response = await connection.handle_async_request(
File "/usr/local/lib/python3.9/site-packages/httpcore/_async/connection.py", line 128, in handle_async_request
async with self.request_lock:
File "/usr/local/lib/python3.9/site-packages/httpcore/_backends/base.py", line 76, in __aenter__
await self.acquire()
File "/usr/local/lib/python3.9/site-packages/httpcore/_backends/anyio.py", line 104, in acquire
await self._lock.acquire()
File "/usr/local/lib/python3.9/site-packages/anyio/_core/_synchronization.py", line 117, in acquire
await checkpoint_if_cancelled()
File "/usr/local/lib/python3.9/site-packages/anyio/lowlevel.py", line 42, in checkpoint_if_cancelled
await get_asynclib().checkpoint_if_cancelled()
Env: Linux : 5.4.0-80-generic
- Running in k8s
Python interpreter : Python 3.9.5
Dependencies :
hpack==4.0.0
httpcore==0.13.6
httptools==0.2.0
httpx==0.18.2
httpx-socks==0.4.1
hyperframe==6.0.1
h11==0.12.0
h2==4.0.0
Did someone already experience the same issue ? My project is using asyncio
package as async lib, so nothing exoctic here. The send
method is called in a multi threaded app.
Thanks, will continue to dig on my side what happened
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
partially initialized module 'asyncio' has no attribute 'Future ...
AttributeError: partially initialized module 'asyncio' has no attribute 'Future' (most likely due to a circular import) tornado==6.0.4 ...
Read more >Python3.6 AttributeError: module 'asyncio' has no attribute 'run'
If anyone is having a problem with no current loop try: loop = asyncio.**new**_event_loop() result = loop.run_until_complete(coro).
Read more >AnyIO - Release 3.6.2 Alex Grönholm
AnyIO is an asynchronous networking and concurrency library that works on top of either asyncio or trio. It implements.
Read more >Error: module 'anyio' has no attribute 'Lock' - Forum
Raised in behalf of user as he is getting this error though using the .NET library and so far he is having no...
Read more >High workload issue "partially initialized module 'anyio ...
High workload issue "partially initialized module 'anyio._backends._asyncio' has no attribute 'checkpoint_if_cancelled'"
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@tomchristie lol that solves my issue, thanks! i was just going by the docs which only use
AsyncClient
as an example and that misled me a bitYou can use HTTP/2 with a regular client…
(Doesn’t need to be async)