Kikyou1997 commented on code in PR #21326:
URL: https://github.com/apache/doris/pull/21326#discussion_r1251443890
##########
fe/fe-core/src/main/java/org/apache/doris/common/util/NetUtils.java:
##########
@@ -100,30 +97,7 @@ public static String getIpByHost(String host) throws
UnknownHostException {
// This is the implementation is inspired by Apache camel project:
public static boolean isPortAvailable(String host, int port, String
portName, String suggestion) {
- ServerSocket ss = null;
- DatagramSocket ds = null;
- try {
- ss = new ServerSocket(port);
- ss.setReuseAddress(true);
- ds = new DatagramSocket(port);
- ds.setReuseAddress(true);
- return true;
- } catch (IOException e) {
- LOG.warn("{} {} is already in use. {}", portName, port,
suggestion, e);
- } finally {
- if (ds != null) {
- ds.close();
- }
-
- if (ss != null) {
- try {
- ss.close();
- } catch (IOException e) {
- /* should not be thrown */
- }
- }
- }
- return false;
+ return true;
Review Comment:
This is a stupid mistake, sorry.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]