On Sun, 13 Sep 2026 10:32:25 GMT, Lee Jiwon <[email protected]> wrote:
>> Disable `IP_TOS` support by default in the JDK's default `ServerSocket` >> implementation and the corresponding `jdk.net.Sockets` option set. >> Applications can restore support with `-Djdk.net.ServerSocket.IP_TOS=true` >> at JVM startup. Support on `Socket` and `DatagramSocket` is unchanged. >> >> Testing on macOS/aarch64: >> - Targeted tests passed, including five `SupportedOptions` configurations. >> - API Javadoc generation passed. >> - Tier 2 reported five locale failures also seen on baseline, one `UdpTest` >> timeout also seen with the opt-in changes reverted, and one docs link-check >> failure involving missing shared files. Other tests passed or were skipped. >> >> Linux and Windows test suites were not run. >> >> The docs link-check failure persisted after `make docs-jdk`; Pandoc is >> disabled in this configuration, and no diagnostics referenced the modified >> `net-properties.html`. >> >> Release note: [JDK-8392329](https://bugs.openjdk.org/browse/JDK-8392329) >> >> --------- >> - [x] I confirm that I make this contribution in accordance with the >> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). > > Lee Jiwon has updated the pull request incrementally with one additional > commit since the last revision: > > 8392151: Disable IP_TOS support on ServerSocket by default src/java.base/share/classes/java/net/doc-files/net-properties.html line 81: > 79: {@code DatagramSocket} is not affected.</P> > 80: </UL> > 81: <P>This property is checked only once, at startup.</P> Does this rise to the level of being documented in net.properties? I'm not sure, let's see if others have opinions. src/java.base/share/classes/sun/nio/ch/Net.java line 99: > 97: public static boolean isServerSocketIPTosEnabled() { > 98: return > Boolean.parseBoolean(VM.getSavedProperty("jdk.net.ServerSocket.IP_TOS")); > 99: } I don't think this rises to the level of the saved properties. So I think drop the change to sun.nio.ch.Net, only NioSocketImpl should know about this property. src/jdk.net/share/classes/jdk/net/Sockets.java line 334: > 332: } > 333: if (Net.isServerSocketIPTosEnabled()) { > 334: set.add(StandardSocketOptions.IP_TOS); I would be tempted to just replace this method with something like the following. This would avoid the duplicate and avoids it getting out of sync with what each socket type supports. private static Map<Class<?>, Set<SocketOption<?>>> optionSets() { var map = new HashMap<Class<?>, Set<SocketOption<?>>>(); try (var s = new Socket()) { map.put(Socket.class, s.supportedOptions()); } catch (IOException e) { throw new IOError(e); } try (var s = new ServerSocket()) { map.put(ServerSocket.class, s.supportedOptions()); } catch (IOException e) { throw new IOError(e); } try (var s = new DatagramSocket()) { map.put(DatagramSocket.class, s.supportedOptions()); } catch (IOException e) { throw new IOError(e); } try (var s = new MulticastSocket(null)) { map.put(MulticastSocket.class, s.supportedOptions()); } catch (IOException e) { throw new IOError(e); } return Map.copyOf(map); } ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/32808#discussion_r3999440781 PR Review Comment: https://git.openjdk.org/jdk/pull/32808#discussion_r3999439868 PR Review Comment: https://git.openjdk.org/jdk/pull/32808#discussion_r3999438074
