k-wall commented on PR #13572:
URL: https://github.com/apache/kafka/pull/13572#issuecomment-1525281763

   Hello @cmccabe, thank you for the feedback.
   
   > since it will allow multiple Kafka servers to be started on the same port
   
   Having read [that SO 
article](https://stackoverflow.com/questions/14388706/how-do-so-reuseaddr-and-so-reuseport-differ)
 I now see the SO_REUSEADDR does indeed have that effect on some platforms.  It 
was not my intent to allow that. I was unknowingly fixating on the Linux 
behaviour.
   
   For example, SO article discusses BSD behaviour:
   
   > Without SO_REUSEADDR, binding socketA to 0.0.0.0:21 and then binding 
socketB to 192.168.0.1:21 will fail (with error EADDRINUSE), since 0.0.0.0 
means "any local IP address", thus all local IP addresses are considered in use 
by this socket and this includes 192.168.0.1, too. With SO_REUSEADDR it will 
succeed, since 0.0.0.0 and 192.168.0.1 are not exactly the same address, one is 
a wildcard for all local addresses and the other one is a very specific local 
address. Note that the statement above is true regardless in which order 
socketA and socketB are bound; without SO_REUSEADDR it will always fail, with 
SO_REUSEADDR it will always succeed.
   
   > Personally, I think that at minimum SO_REUSEADDR should be an option (not 
mandatory) and probably not the default.
   
   I'd be happy to resubmit the PR in this way.
   


-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to