-
Notifications
You must be signed in to change notification settings - Fork 0
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
first implementation #1
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.
Still reviewing, but once I commented
I have not been able to review all the codes, so please wait a little longer!
go.mod
Outdated
@@ -0,0 +1,5 @@ | |||
module github.com/go-misc/async-retry |
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.
[nits]
How about github.com/Kyash/async-retry
as a module name?
I don't have a strong opinion, so I'll leave it to you to decide if you want to modify it or not.
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.
This is just a trash made when I developed at local environment. Thanks!
cf84aa6
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 quick fix!
Please also fix the sample code listed in the README
https://github.com/Kyash/async-retry/blob/first-impl/README.md?plain=1#L26
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.
Commented.
Review is complete
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
a.mu.Lock() | ||
select { | ||
case <-a.shutdownChan: | ||
return InShutdownErr |
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.
mu.Unlock()
is not called when a.shutdownChan
is already closed.
This means that if a asyncRetry.Do
is called twice on asyncRetry resource that has already been shutdown, the second call will fail to acquire a mu.Lock()
and will result in a deadlock.
I think it should be fixed.
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.
Thx!
You are right!
I've just submitted for this bug: #4
What I did
Please read README and test codes to understand features and interfaces.
Feel free to ask questions if you have.
I found a bug after submitting this PR, I'll fix in a new PR!
see: #2
Next Action
I'll submit as new PRs for features below soon.
Fix bug of github.com/avast/retry-go and submit PR. If merged, I'll update version.[Update] done at 6eadc4e