Skip to content
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

Merged
merged 4 commits into from May 19, 2020

Conversation

wolfstudy
Copy link
Member

Signed-off-by: xiaolong.ran rxl@apache.org

Motivation

Due to the use of goroutine, stop <-chan struct {} cannot be seen.

Modifications

  • Fix perf-produce cannot be closed

Signed-off-by: xiaolong.ran <rxl@apache.org>
@wolfstudy wolfstudy self-assigned this May 19, 2020
@wolfstudy wolfstudy requested a review from merlimat May 19, 2020 04:50
@wolfstudy wolfstudy added this to the 0.1.1 milestone May 19, 2020
@wolfstudy
Copy link
Member Author

@cckellogg PTAL

Copy link
Contributor

@cckellogg cckellogg left a 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

@@ -98,7 +98,7 @@ func produce(produceArgs *ProduceArgs, stop <-chan struct{}) {

ch := make(chan float64)

go func() {
go func(stop <-chan struct{}) {
Copy link
Contributor

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?

Copy link
Member Author

@wolfstudy wolfstudy May 19, 2020

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

Copy link
Contributor

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>
@wolfstudy
Copy link
Member Author

run integration tests

@wolfstudy wolfstudy merged commit e6d73af into apache:master May 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants