uschindler commented on issue #12964: URL: https://github.com/apache/lucene/issues/12964#issuecomment-1868277275
Hi, it looks like your linux kernel has an extended ephemeral port range. The RFC defines it to be 49152-65535 (see RFC 6335). > The [range itself](https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/net/SocketPermission.java#L244) is defined by `jdk.net.ephemeralPortRange.low` / `jdk.net.ephemeralPortRange.high` system properties. > And when those are not set the range defaults to 49152 - 65535: > https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/net/SocketPermission.java#L1228 This is not fully true. If the sysprops are undefined (which is by default), it only uses 49152-65535 on Windows (as Windows adheres to the standard). This default range is defined in `PortConfig` class which has several implementation depending on operating system. For Linux it uses this class: https://github.com/openjdk/jdk/blob/28c82bf18d85be00bea45daf81c6a9d665ac676f/src/java.base/unix/classes/sun/net/PortConfig.java#L36; for Windows it uses: https://github.com/openjdk/jdk/blob/28c82bf18d85be00bea45daf81c6a9d665ac676f/src/java.base/windows/classes/sun/net/PortConfig.java#L33 In short the default range is defined in a platform dependent way, but on Linux, it uses a hardcoded range: ```java case LINUX: defaultLower = 32768; defaultUpper = 61000; ``` This matches the defaults in Linux kernel variables: ```sh # sysctl net.ipv4.ip_local_port_range net.ipv4.ip_local_port_range = 32768 60999 ``` Unfortunetaly on Linux it does not read that sysctl, so if you have changed it on your `/etc/sysctl.conf` or in `/etc/sysctl.d` files (some network administrators do this on webservers to allow more connections in parallel). But on a desktop env like used for development this should never ever be done. So please print what your current kernel uses by executing `sysctl net.ipv4.ip_local_port_range` and if it does not adere to the default please fix your config. If you strongly think that the `PortConfig` class in the JDK should read the sysctl setting instead of hardcoding a range, please open a bug report on OpenJDK. So this is a configuration issue or a bug in OpenJDK. Lucene behaves correctly. As we only work on localhost, the port ranges are always ephemeral so changing the policy is not needed. -- 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: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org