You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/05/19 04:50:19 UTC

[GitHub] [pulsar-client-go] wolfstudy opened a new pull request #255: Fix perf-produce cannot be closed

wolfstudy opened a new pull request #255:
URL: https://github.com/apache/pulsar-client-go/pull/255


   Signed-off-by: xiaolong.ran <rx...@apache.org>
   
   ### Motivation
   
   Due to the use of goroutine, `stop <-chan struct {}` cannot be seen.
   
   
   
   ### Modifications
   
   - Fix perf-produce cannot be closed
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar-client-go] cckellogg commented on a change in pull request #255: Fix perf-produce cannot be closed

Posted by GitBox <gi...@apache.org>.
cckellogg commented on a change in pull request #255:
URL: https://github.com/apache/pulsar-client-go/pull/255#discussion_r427047810



##########
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:
       Please remove the `perf/pulsar-perf-go` bin file




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar-client-go] wolfstudy commented on pull request #255: Fix perf-produce cannot be closed

Posted by GitBox <gi...@apache.org>.
wolfstudy commented on pull request #255:
URL: https://github.com/apache/pulsar-client-go/pull/255#issuecomment-630578147


   @cckellogg PTAL


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar-client-go] wolfstudy merged pull request #255: Fix perf-produce cannot be closed

Posted by GitBox <gi...@apache.org>.
wolfstudy merged pull request #255:
URL: https://github.com/apache/pulsar-client-go/pull/255


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar-client-go] wolfstudy commented on pull request #255: Fix perf-produce cannot be closed

Posted by GitBox <gi...@apache.org>.
wolfstudy commented on pull request #255:
URL: https://github.com/apache/pulsar-client-go/pull/255#issuecomment-630627005


   run integration tests


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar-client-go] wolfstudy commented on a change in pull request #255: Fix perf-produce cannot be closed

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



[GitHub] [pulsar-client-go] cckellogg commented on a change in pull request #255: Fix perf-produce cannot be closed

Posted by GitBox <gi...@apache.org>.
cckellogg commented on a change in pull request #255:
URL: https://github.com/apache/pulsar-client-go/pull/255#discussion_r427031983



##########
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? Just curious what are the steps for it getting stuck?




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar-client-go] wolfstudy commented on a change in pull request #255: Fix perf-produce cannot be closed

Posted by GitBox <gi...@apache.org>.
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 




----------------------------------------------------------------
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:
users@infra.apache.org