Skip to content

Fix HttpClient misuse: reuse static instance, remove duplicate headers, add missing error handling#3715

Open
ArthurPatriot wants to merge 1 commit into
ArduPilot:masterfrom
ArthurPatriot:fix/http-reuse
Open

Fix HttpClient misuse: reuse static instance, remove duplicate headers, add missing error handling#3715
ArthurPatriot wants to merge 1 commit into
ArduPilot:masterfrom
ArthurPatriot:fix/http-reuse

Conversation

@ArthurPatriot
Copy link
Copy Markdown
Contributor

@ArthurPatriot ArthurPatriot commented Apr 27, 2026

HttpClient was being instantiated on every request across Download, Tracking, and adsb. This is a well-known anti-pattern that exhausts the system's socket pool under load (each disposed instance holds a socket in TIME_WAIT for up to 4 minutes).

@ArthurPatriot ArthurPatriot force-pushed the fix/http-reuse branch 2 times, most recently from c4583df to 4634d72 Compare April 27, 2026 16:09
@ArthurPatriot ArthurPatriot changed the title Consolidate HttpClient usage to prevent socket exhaustion Fix HttpClient misuse: reuse static instance, remove duplicate headers, add missing error handling Apr 27, 2026
@ArthurPatriot ArthurPatriot marked this pull request as ready for review April 27, 2026 19:03
@ArthurPatriot
Copy link
Copy Markdown
Contributor Author

@meee1 when you have a time

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.

1 participant