cserwen opened a new issue, #1051:
URL: https://github.com/apache/rocketmq-client-go/issues/1051
### # The Question
For the consumer, the closing and writing of msgCh are in two coroutines.
Even though the chan of `closeChan` is added, since multiple `case` clauses are
randomly executed for the `select` statement, it is still possible Write data
to a closed channel
```go
if !pq.order {
select {
case <-pq.closeChan:
return
case pq.msgCh <- messages:
}
}
```
https://github.com/apache/rocketmq-client-go/blob/master/consumer/process_queue.go#LL124C1-L130C3
### # How fo fix?
We'd better close the channel in the goroutine that pullMessage to avoid
closing and writing at the same time.
--
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]