feat: improve HTTP robustness with httpx and retry logic#121
Open
jethac wants to merge 1 commit intoLaurieWired:mainfrom
Open
feat: improve HTTP robustness with httpx and retry logic#121jethac wants to merge 1 commit intoLaurieWired:mainfrom
jethac wants to merge 1 commit intoLaurieWired:mainfrom
Conversation
- Replace requests with httpx for better connection pooling - Add tenacity for automatic retry on transient failures - Retry up to 3 times with exponential backoff on ConnectError/ConnectTimeout - Add connection-pooled HTTP client singleton
This was referenced Jan 11, 2026
jethac
added a commit
to jethac/GhidraMCP
that referenced
this pull request
Jan 11, 2026
- Add PORT_RANGE (8080-8089) for scanning active Ghidra instances - Add discover_instances() to find running Ghidra servers - Add get_instance_url() for routing requests to specific instances - Add list_ghidra_instances() tool to list available instances - Add target_binary parameter to all tools for instance routing Depends-On: LaurieWired#121
jethac
added a commit
to jethac/GhidraMCP
that referenced
this pull request
Jan 11, 2026
- Add PORT_RANGE (8080-8089) for scanning active Ghidra instances - Add discover_instances() to find running Ghidra servers - Add get_instance_url() for routing requests to specific instances - Add list_ghidra_instances() tool to list available instances - Add target_binary parameter to all tools for instance routing Depends-On: LaurieWired#121
bethington
approved these changes
Feb 11, 2026
bethington
left a comment
There was a problem hiding this comment.
LGTM! httpx with retry logic is a solid improvement for reliability.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tl,dr
requestswithhttpxfor connection pooling and better timeout handlingtenacityfor automatic retry with exponential backoff on transient failuresBackground
The current requests-based implementation creates a new TCP connection for every single API call and has no retry logic. This causes real problems:
Problem 1: Connection Churn
When an LLM is analyzing a binary, it makes dozens of rapid-fire calls (list_functions, decompile, get_xrefs, etc.). Each call opens a new connection, does one request, then tears it down. This adds latency and wastes resources.
Problem 2: No Fault Tolerance
If Ghidra is momentarily busy (e.g., still processing a large decompilation) or there's a brief network hiccup, the request fails immediately. The user sees
Request failed: Connection refused and has to retry manually.What This PR Fixes:
Practical Impact:
The retry only triggers on
ConnectErrorandConnectTimeout- actual API errors (4xx/5xx) still fail fast as expected.Changes
Testing