paul8263 commented on a change in pull request #16108:
URL: https://github.com/apache/flink/pull/16108#discussion_r763838385



##########
File path: 
flink-connectors/flink-connector-kafka/src/test/java/org/apache/flink/streaming/connectors/kafka/KafkaTestEnvironmentImpl.java
##########
@@ -125,7 +126,13 @@ public void prepare(Config config) throws Exception {
         zookeeper = null;
         brokers.clear();
 
+        // Use a file lock to avoid race condition when creating and starting 
Zookeeper
+        // TestingServer, which may lead to java.net.BindException: Address 
already in use.
+        FileLock fileLock = new FileLock(getClass().getName() + "fileLock");

Review comment:
       Hi @AHeise ,
   I moved the FlieLock to flink core within the same package as NetUtils and 
created a class named Port, which holds a port and FileLock. The FileLock would 
be automatically unlocked with the help of AutoClosable.




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to