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 2021/05/05 19:18:16 UTC

[GitHub] [pulsar-client-go] hunter2046 opened a new pull request #514: Make PartitionsAutoDiscoveryInterval configurable

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


   ### Motivation
   `partitionsAutoDiscoveryInterval` is currently hardcoded to 1 minute: https://github.com/apache/pulsar-client-go/blob/6ab17dcca28db389ab91a4a2ea6e5ae990d613da/pulsar/producer_impl.go#L60. I could think of two reasons for making it a configurable value:
   * A faster or slower partitions discovery is desired. A faster one is more likely when users would like a partition increment to be effective more quickly.
   * Allow a test to be able to set it to a much smaller time duration so that the test could exercise the logic within a reasonable short time
   
   ### Modifications
   
   Added `PartitionsAutoDiscoveryInterval` into `ProducerOptions` with a default value of 1 minute.
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   ### Does this pull request potentially affect one of the following parts:
   
   *If `yes` was chosen, please highlight the changes*
   
     - Dependencies (does it add or upgrade a dependency): (yes / **no**)
     - The public API: (yes / **no**)
     - The schema: (yes / **no** / don't know)
     - The default values of configurations: (yes / **no**)
     - The wire protocol: (yes / **no**)
   
   ### Documentation
   
     - Does this pull request introduce a new feature? (yes / **no**)
     - If yes, how is the feature documented? (not applicable / docs / GoDocs / **not documented**)
     - If a feature is not applicable for documentation, explain why?
     - If a feature is not documented yet in this PR, please create a followup issue for adding the documentation
   


-- 
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] hunter2046 commented on a change in pull request #514: Make PartitionsAutoDiscoveryInterval configurable

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



##########
File path: pulsar/producer_impl.go
##########
@@ -87,6 +88,9 @@ func newProducer(client *client, options *ProducerOptions) (*producer, error) {
 	if options.BatchingMaxPublishDelay <= 0 {
 		options.BatchingMaxPublishDelay = defaultBatchingMaxPublishDelay
 	}
+	if options.PartitionsAutoDiscoveryInterval == 0 {

Review comment:
       Thanks for the catch. Updated the check to include negative values.




-- 
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] merlimat merged pull request #514: Make PartitionsAutoDiscoveryInterval configurable

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


   


-- 
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 #514: Make PartitionsAutoDiscoveryInterval configurable

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



##########
File path: pulsar/producer_impl.go
##########
@@ -87,6 +88,9 @@ func newProducer(client *client, options *ProducerOptions) (*producer, error) {
 	if options.BatchingMaxPublishDelay <= 0 {
 		options.BatchingMaxPublishDelay = defaultBatchingMaxPublishDelay
 	}
+	if options.PartitionsAutoDiscoveryInterval == 0 {

Review comment:
       What happens if a negative value is passed in?




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