BewareMyPower commented on code in PR #1502:
URL: https://github.com/apache/pulsar-client-go/pull/1502#discussion_r3333153454
##########
pulsar/blue_green_migration_test.go:
##########
@@ -148,6 +149,7 @@ func testTopicMigrate(
// Signals both producer and consumer have processed
`messageCountBeforeUnload` messages
wgSendAndReceiveMessages := sync.WaitGroup{}
wgSendAndReceiveMessages.Add(2)
+ errCh := make(chan error, 1)
Review Comment:
There are two goroutines, the 1st could send the error to `errCh`, the
`doneCh` receives a message after two goroutines are done. i.e. if the 1st
goroutine completes before the 2nd one, there could be a race.
But if `doneCh` receives a message, the error is guaranteed to be sent to
`errCh` if there is an error. Therefore, changing the error into an
`atomic.Value` should make sense
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]