wolfstudy commented on a change in pull request #255:
URL: https://github.com/apache/pulsar-client-go/pull/255#discussion_r427043780
##########
File path: perf/perf-producer.go
##########
@@ -98,7 +98,7 @@ func produce(produceArgs *ProduceArgs, stop <-chan struct{}) {
ch := make(chan float64)
- go func() {
+ go func(stop <-chan struct{}) {
Review comment:
> maybe rename this the stopCh so it's clear in the go routine which one
it's using?
ok
> Just curious what are the steps for it getting stuck?
```
func produce(produceArgs *ProduceArgs, stop <-chan struct{}) {
.....
go func() {
for {
select {
case <-stop:
return
....
}
}()
......
}
```
In gorutine, the external `stop` parameter is not visible to it, so the
program is blocked inside this gorutine. When the user enters `control + c` in
the terminal, the program is blocked and does not exit normally
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]