-
Notifications
You must be signed in to change notification settings - Fork 344
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 perf-produce cannot be closed #255
Conversation
Signed-off-by: xiaolong.ran <rxl@apache.org>
@cckellogg PTAL |
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.
We don't need the bin file
perf/perf-producer.go
Outdated
@@ -98,7 +98,7 @@ func produce(produceArgs *ProduceArgs, stop <-chan struct{}) { | |||
|
|||
ch := make(chan float64) | |||
|
|||
go func() { | |||
go func(stop <-chan struct{}) { |
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.
maybe rename this the stopCh so it's clear in the go routine which one it's using? Just curious what are the steps for it getting stuck?
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.
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
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.
Please remove the perf/pulsar-perf-go
bin file
Signed-off-by: xiaolong.ran <rxl@apache.org>
Signed-off-by: xiaolong.ran <rxl@apache.org>
Signed-off-by: xiaolong.ran <rxl@apache.org>
run integration tests |
Signed-off-by: xiaolong.ran rxl@apache.org
Motivation
Due to the use of goroutine,
stop <-chan struct {}
cannot be seen.Modifications