NIFI-11603: Removed NetworkUtils.getAvailableUdpPort, NetworkUtils.ge…#7299
NIFI-11603: Removed NetworkUtils.getAvailableUdpPort, NetworkUtils.ge…#7299markap14 wants to merge 3 commits intoapache:mainfrom
Conversation
…tAvailableTcpPort and NetworkUtils.getAvailablePort as well as NetworkUtils.isListening
|
building on a local osx and linux set of machines now. |
|
with -Pinclude-grpc it appears some bits were missed [INFO] ------------------------------------------------------------------------ |
|
Thanks @joewitt missed that one since I didn't build with the profile |
exceptionfactory
left a comment
There was a problem hiding this comment.
Thanks for addressing these issues @markap14, the approach looks good. I only noticed two minor things, one was an unused member variable and the other was a hard-coded client port number, otherwise this looks good.
| private volatile SyslogParser parser; | ||
| private volatile BlockingQueue<ByteArrayMessage> syslogEvents = new LinkedBlockingQueue<>(); | ||
| private volatile byte[] messageDemarcatorBytes; //it is only the array reference that is volatile - not the contents. | ||
| private volatile int listeningPort; |
There was a problem hiding this comment.
This value does not appear to be assigned.
| @Test | ||
| public void testWithSendingHostAndPortSameAsSender() throws IOException, InterruptedException { | ||
| final Integer sendingPort = NetworkUtils.getAvailableUdpPort(); | ||
| final int sendingPort = 27911; |
There was a problem hiding this comment.
Will this hard-coded port result in intermittent failures? Can it be set to 0 for constructing the DatagramSocket?
There was a problem hiding this comment.
Good catch, I meant to come back to that one, as I wasn't 100% sure what was happening there. Will address, though.
exceptionfactory
left a comment
There was a problem hiding this comment.
Thanks for the updates @markap14, the latest version looks good! +1 merging
…tAvailableTcpPort and NetworkUtils.getAvailablePort as well as NetworkUtils.isListening
Summary
NIFI-00000
Tracking
Please complete the following tracking steps prior to pull request creation.
Issue Tracking
Pull Request Tracking
NIFI-00000NIFI-00000Pull Request Formatting
mainbranchVerification
Please indicate the verification steps performed prior to pull request creation.
Build
mvn clean install -P contrib-checkLicensing
LICENSEandNOTICEfilesDocumentation