-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
rpcclient: fix crash in http retry handler #1856
Conversation
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.
LGTM, nice fix 🎉
rpcclient/infrastructure.go
Outdated
select { | ||
case <-time.After(backoff): | ||
|
||
case <-shutdown: |
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.
👍
Tried this on my local machine running while running lightningnetwork/lnd#6345. I still get the panic error, as the response is nil, and all the retries fail since the my |
Pull Request Test Coverage Report for Build 2295615882Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
52a3fbc
to
fff3453
Compare
In my case the |
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!
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.
Thanks for the clarifications! Latest changes are looking a lot better, one final comment re trying to pass back more descriptive error.
This commit fixes the error that is masked inside the for loop's scope. Previously after max retries the error didn't leave the for scope and therefore httpResponse remained nil which in turn resulted in a crash.
This commit removes Sleep() from the rety handler so that the shutdown request is always respected. Furthermore the maximum retry count is corrected.
ptal |
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.
LGTM 🚵🏼♂️
This PR fixes a crash that happens every time when the post errors max retries times.