Skip to content

Conversation

@maya-undefined
Copy link

@maya-undefined maya-undefined commented Oct 16, 2025

The client is aiohttp but we are catching a requests exception which may not get caught

Use asyncio.sleep instead of time.sleep(), which can cause entire event loop to pause.

There is also a possible semaphore leak. We acquire the semaphore under a branch but we release it in the finally in all cases.

not get caught

Use `asyncio.sleep` instead of time.sleep(), which can cause entire event
loop to pause
@maya-undefined maya-undefined changed the title aiohttp exceptions & asyncio.sleep aiohttp exceptions, semaphore leak, asyncio.sleep Oct 16, 2025
except ValueError as e:
log.debug(f"Error downloading key: {e}")
time.sleep(15)
await sleep(15)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_fetch_pubkey is not guaranteed to be only called in an async context; we should mark it (and its whole calling chain) async if it needs to be called in an async context.

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.

2 participants