Pin ProtonVPN sessions to the plain transport #165
Loading…
Reference in a new issue
No description provided.
Delete branch "pin-proton-transport"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
A successful scheduled renewal dumped a full aiohttp traceback and four
Task was destroyed but it is pending!errors into the log. proton-core's defaultAutoTransportraces the plain transport againstAlternativeRoutingTransportwith a 5s head start; the renewal'srefresh()ran ~11s, so ART fired its discovery — DoH queries to hardcoded Google (8.8.4.4/8.8.8.8 + v6) and Quad9 resolvers — the v6 probe raised on a v6-less network, and when the primary transport won, the abandoned racer tasks surfaced as ERROR tracebacks. Besides the noise, that's a root service phoning third-party DNS whenever Proton's API is momentarily slow (#164).Fix
load_proton_corenow hands out a session factory that pinssession.transport_factory = AiohttpTransport— exactly auto's primary transport, minus the racer. Both the login and renewal paths build sessions through it.Trade-off, accepted: on a network where Proton's API is blocked, an import fails with the normal network error instead of possibly succeeding via alternative routing's fallback domains. The task leak itself is an upstream python-proton-core bug regardless.
Verification
pytestgreen (370 passed) plus the ruff/compileall gates.Closes #164
🤖 Generated with Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.