-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance Proof Courier Handlers with Lazy Connection Attempts for HashMail and UniverseRPC #1092
Conversation
Pull Request Test Coverage Report for Build 10506105341Details
💛 - Coveralls |
cd2dd0f
to
afe2b87
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice refactor! Looks good to me 🎉
81353e7
to
9a021a1
Compare
This commit updates the HashMail proof courier handler to make connection attempts optionally lazy. Connection attempts are now integrated into the backoff procedure where feasible, improving the robustness of the connection handling process.
9a021a1
to
9756424
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems solid! Few comments:
- Would be good for the initial sentence for commit 2 to be different from commit 1.
- What's the recommended setup once this PR is in; should
lazyConnect
always be true?
From itests passing (including those using backoff) this is covered in testing, which is nice.
const ( | ||
// CourierConnStatusUnknown indicates that the connection status is | ||
// unknown. | ||
CourierConnStatusUnknown CourierConnStatus = iota |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
non-blocking nit: may be good to have unknown
after disconnected
, to follow the enum pattern we have elsewhere / make comparison a bit safer.
Though with exhaustive switches I suppose the order doesn't matter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's a good idea to have unknown
as the first enum value, ensuring that the default for a CourierConnStatus
variable is unknown
. Which means that if we don't set the field, it won't default to something opinionated.
|
||
// At this point, we know that the connection is not ready. We'll now | ||
// attempt to establish a new connection to the courier service. | ||
dialOpts, err := serverDialOpts() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mentioned offline that you wanted the option for the connection setup to be blocking; I think adding the WithBlock()
grpc.DialOption
would work for that.
https://pkg.go.dev/google.golang.org/[email protected]#WithBlock
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what I've been playing around with in conjunction with DialContext
👍
@jharveyb I'm not sure what you mean. Should I make them different for clarity? I think you want the commit subject to be different. I've changes the second commit slightly.
|
9756424
to
cbe2e2d
Compare
This commit modifies the Universe RPC proof courier handler to allow connection attempts to be optionally lazy. Connection attempts are now integrated into the backoff procedure where feasible, improving the robustness of the connection handling process.
cbe2e2d
to
e514015
Compare
This PR introduces updates to the HashMail and UniverseRPC proof courier handlers, specifically making connection attempts optionally lazy. The changes are aimed at enhancing the robustness of the connection handling process by integrating these attempts into the backoff procedure where feasible.