-
Notifications
You must be signed in to change notification settings - Fork 20
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
Enable MultiProcessor in processor.go #217
Conversation
Pull Request Test Coverage Report for Build 8776717166Details
💛 - Coveralls |
wg := sync.WaitGroup{} | ||
errChan := make(chan error, len(p.receivers)) | ||
for name := range p.receivers { | ||
wg.Add(1) |
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.
Here, if startOne panics, or if the cahnnel is closed for example, and we try to push err on it, we will not call wg.Done() because we don't recover from the panic, I believe.
So I think that the wg.Wait() will keep us stuck forever.
could you try to add a test for that by generating a panic somehow inside startOne ?
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.
in terms of fixing it, I've been itching to use conc library in go-shuttle, but unsure whether that's wise as a library.
we should handle the panic I think...
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.
added panic handling + UTs
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.
Ok let's get this in. we might want to adjust some things once we write integration code around it.
User can add more than one receiver to listen to with go-shuttle's Processor.
Use
NewMultiProcessor()
to initialize a list of receivers in a ProcessorNote: max concurrency count is shared across all receivers.
MultiProcessor is not yet compatible with LockRenewer.