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/06/19 03:30:12 UTC

[GitHub] [pulsar-client-go] shohi opened a new pull request #289: fix panic when creating consumer with ReceiverQueueSize set to -1

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


   Fixes https://github.com/apache/pulsar-client-go/issues/288
   


----------------------------------------------------------------
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 #289: fix panic when creating consumer with ReceiverQueueSize set to -1

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


   > > > // Set to -1 to disable prefetching in consumer
   > > > ReceiverQueueSize int
   > > 
   > > 
   > > @shohi Can you remove the comments from `ReceiverQueueSize`?
   > 
   > Or change the description?
   
   Yes.


----------------------------------------------------------------
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 #289: fix panic when creating consumer with ReceiverQueueSize set to -1

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



##########
File path: pulsar/consumer_impl.go
##########
@@ -74,6 +74,11 @@ func newConsumer(client *client, options ConsumerOptions) (Consumer, error) {
 		options.ReceiverQueueSize = 1000
 	}
 
+	// disable receiver queue if queue size is negative
+	if options.ReceiverQueueSize < 0 {
+		options.ReceiverQueueSize = 0
+	}

Review comment:
       This is related to the flow mechanism of messages in pulsar. By default, the value of the receiveQueueSize is 1000




----------------------------------------------------------------
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 #289: fix panic when creating consumer with ReceiverQueueSize set to -1

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


   > 	// Set to -1 to disable prefetching in consumer
   	ReceiverQueueSize int
   
   @shohi Can you remove the comments from `ReceiverQueueSize`?


----------------------------------------------------------------
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 #289: fix panic when creating consumer with ReceiverQueueSize set to -1

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


   


----------------------------------------------------------------
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] shohi commented on a change in pull request #289: fix panic when creating consumer with ReceiverQueueSize set to -1

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



##########
File path: pulsar/consumer_impl.go
##########
@@ -74,6 +74,11 @@ func newConsumer(client *client, options ConsumerOptions) (Consumer, error) {
 		options.ReceiverQueueSize = 1000
 	}
 
+	// disable receiver queue if queue size is negative
+	if options.ReceiverQueueSize < 0 {
+		options.ReceiverQueueSize = 0
+	}

Review comment:
       not sure whether it's a good idea to remove this option. If negative value is totally disallowed (should be reflected in comments), i think it's ok to panic though.




----------------------------------------------------------------
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] shohi commented on a change in pull request #289: fix panic when creating consumer with ReceiverQueueSize set to -1

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



##########
File path: pulsar/consumer_impl.go
##########
@@ -74,6 +74,11 @@ func newConsumer(client *client, options ConsumerOptions) (Consumer, error) {
 		options.ReceiverQueueSize = 1000
 	}
 
+	// disable receiver queue if queue size is negative
+	if options.ReceiverQueueSize < 0 {
+		options.ReceiverQueueSize = 0
+	}

Review comment:
       Ok, i'll update the modification and comments according to your suggestions.




----------------------------------------------------------------
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] shohi commented on pull request #289: fix panic when creating consumer with ReceiverQueueSize set to -1

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


   > > // Set to -1 to disable prefetching in consumer
   > > ReceiverQueueSize int
   > 
   > @shohi Can you remove the comments from `ReceiverQueueSize`?
   
   Or change the description?


----------------------------------------------------------------
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 #289: fix panic when creating consumer with ReceiverQueueSize set to -1

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



##########
File path: pulsar/consumer_impl.go
##########
@@ -74,6 +74,11 @@ func newConsumer(client *client, options ConsumerOptions) (Consumer, error) {
 		options.ReceiverQueueSize = 1000
 	}
 
+	// disable receiver queue if queue size is negative
+	if options.ReceiverQueueSize < 0 {
+		options.ReceiverQueueSize = 0
+	}

Review comment:
       Maybe we can fix it using follows way:
   
   ```
   	if options.ReceiverQueueSize <= 0 {
   		options.ReceiverQueueSize = 1000
   	}
   ```




----------------------------------------------------------------
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] shohi commented on a change in pull request #289: fix panic when creating consumer with ReceiverQueueSize set to -1

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



##########
File path: pulsar/consumer_impl.go
##########
@@ -74,6 +74,11 @@ func newConsumer(client *client, options ConsumerOptions) (Consumer, error) {
 		options.ReceiverQueueSize = 1000
 	}
 
+	// disable receiver queue if queue size is negative
+	if options.ReceiverQueueSize < 0 {
+		options.ReceiverQueueSize = 0
+	}

Review comment:
       unbuffered chan may be useful for some cases.




----------------------------------------------------------------
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