fix: fixing initial connection failure to cache loop#2235
Conversation
Review Summary by QodoFix cache connection loop and goroutine leak issues
WalkthroughsDescription• Store gRPC connection to properly close on reconnect, preventing goroutine leaks • Fix reconnection loop logic that was inverted, causing immediate exit on success • Add connection error detection to trigger reconnection on unavailable status • Improve logging and add gRPC imports for connection management Diagramflowchart LR
A["Cache Client Store"] -->|"stores connection"| B["gRPC ClientConn"]
A -->|"detects errors"| C["resetOnConnectionError"]
C -->|"clears client"| A
C -->|"triggers"| D["reconnectClient loop"]
D -->|"on success"| E["closes old conn & stores new"]
E -->|"exits loop"| F["Ready for requests"]
File Changes1. protocol/performance/cache.go
|
Code Review by Qodo
1.
|
Codecov Report❌ Patch coverage is
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 8 files with indirect coverage changes 🚀 New features to boost your workflow:
|
User description
Description
Closes: #XXXX
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!in the type prefix if API or client breaking changemainbranchReviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
Generated description
Below is a concise technical summary of the changes proposed in this PR:
Fix the cache client lifecycle so
relayerCacheClientStoreretains the gRPC connection, closes old*grpc.ClientConninstances, and surfaces detailed logging around connection attempts to prevent goroutine leaks during initial startup failures. EnsureCacherequests triggerresetOnConnectionErrorand that the reconnection loop logs its progress and exits promptly oncecodes.Unavailablefailures are resolved.connectClientsucceeds, and resetting the cached client oncodes.Unavailableerrors surfaced inGetEntry/SetEntry.Modified files (1)
Latest Contributors(2)
*grpc.ClientConn, closing the previous connection before replacement, and adjusting logs to reflect connection states.Modified files (1)
Latest Contributors(2)