Skip to content

Conversation

@hadess
Copy link
Contributor

@hadess hadess commented Jun 26, 2025

Fixed the build at flathub/org.ghidra_sre.Ghidra#104 using this

With a sufficiently large number of URLs to process, the script would
fail with:

pycares.AresError: Failed to initialize c-ares channel

which usually means that process resources are exhausted.

Use a single HTTP session for aiohttp, as recommended in the
aiohttp docs:

Don’t create a session per request. [...]
[M]aking a session for every request is a very bad idea.
A session contains a connection pool inside.

See https://docs.aiohttp.org/en/stable/client_quickstart.html

Reproduce using:

$ LOGLEVEL=info ./flatpak-gradle-generator.py gradle-log.txt ../gradle-dependencies.json --destdir dependencies/flatRepo --arches x86_64,aarch64

It will fail with the original code, and work with the fixed one.

gradle-log.txt

hadess added 2 commits June 26, 2025 12:08
With a sufficiently large number of URLs to process, the script would
fail with:
pycares.AresError: Failed to initialize c-ares channel

which usually means that process resources are exhausted.

Use a single HTTP session for aiohttp, as recommended in the
aiohttp docs:
> Don’t create a session per request. [...]
> [M]aking a session for every request is a very bad idea.
> A session contains a connection pool inside.

See https://docs.aiohttp.org/en/stable/client_quickstart.html
@hadess hadess added the gradle label Jun 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants