-
Notifications
You must be signed in to change notification settings - Fork 60
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
fix: panic send on closed channel in reader pkg #220
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.
Could you reproduce the bug reported in these issues? And do you verify the solution?
pkg/cmd/runner.go
Outdated
// fix issues/219 | ||
// May cause base.FILEDONE to send multiple times, so <-statsMgr.DoneCh return, and then program exit. | ||
// It may lead to incomplete import, or even panic. | ||
return |
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'm confused about the purpose of this return
. Even though without this return
, this function still always exit when it reaches here.
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.
Yes, I am solving. It's wip.
12c8581
to
1ef9e5e
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.
LGTM
fix: panic send on closed channel in reader pkg
The number of times
statsMgr.StatsCh <- base.NewFileDoneStats(filename)
has reached the number of readers,then
<-statsMgr.DoneCh
return, but not all readers have exited.So, it's need to wait for it exit.