becketqin opened a new pull request #12286:
URL: https://github.com/apache/flink/pull/12286


   ## What is the purpose of the change
   Before this patch, Kafka brokers in the IT cases are assigned with port from 
`NetUtils.getAvailablePort()`. This is a little fragile because there is no 
guarantee that the port will not be recycled and used by someone else when the 
broker comes up. There was retries added to avoid the case, but we still see 
`BindExceptions` from time to time.
   
   This patch solve this problem by letting the broker start the listeners with 
random ports.
   
   ## Brief change log
   bfc52432ddb2fc1ea708230e23f449be23df0370 Let the broker pick their own 
random port instead of using `NetUtils.getAvailablePort()`.
   
   ## Verifying this change
   Run the tests repeatedly in Intellij without seeing `BindException` anymore. 
Before the patch the exception is likely to be thrown after 10 - 20 runs.
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API, i.e., is any changed class annotated with 
`@Public(Evolving)`: (no)
     - The serializers: (no)
     - The runtime per-record code paths (performance sensitive): (no)
     - Anything that affects deployment or recovery: JobManager (and its 
components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: (no)
     - The S3 file system connector: (no)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (no)
     - If yes, how is the feature documented? (not applicable)
   


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


Reply via email to