Merged
Conversation
|
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
fcostaoliveira
approved these changes
Apr 14, 2026
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.



Problem
When Redis returns an error like OOM
ftsb_redisearchgets stuck and no more commands are sent to the server.Each worker uses a
radix.Poolwith a single connection. When Redis returns an error, the server may close the connection. But the radix pool doesn't know the connection is dead — it tries to reuse it for the next command. The write might go through (buffered in TCP), but the read hangs waiting for a response that never comes. The worker blocks, stops sending ACKs to the scanner, and the whole pipeline freezes.Fix
Extracted connection creation into reusable helpers —
getDialOpts(),getCustomConnFunc(), andcreatePool()— so the same pool configuration can be used both at init and when reconnecting.Added
reconnectPool()— a method that closes the existing pool and creates a fresh one. It logs success/failure and respects the--continue-on-errorflag.Propagated error status up the call chain —
sendIfRequiredandsendFlatCmdnow return abool hadErrorso the caller knows when something went wrong.Reconnect after errors in
connectionProcessor— when a command fails in non-cluster mode and--continue-on-erroris enabled, it immediately closes the old pool and creates a new connection before sending the next command. This prevents hanging on a broken/half-closed connection.Improved
Close()cleanup — properly closes pool and cluster connections when the processor shuts down.Result
Instead of getting stuck forever after an OOM (or similar) error, the tool reconnects and continues benchmarking. The reconnection is logged as
"Successfully reconnected to Redis after error".