Jetty 10.0.15 error Could not configure SO_REUSEPORT to false on sun.nio.ch.ServerSocketChannelImpl[unbound]

348 views Asked by At

We have upgrade jetty from 9.4.30 to 10.0.15.

After Jetty upgrade RESTful services are not running getting below error

org.eclipse.jetty.server.AbstractConnector - Could not configure SO_REUSEPORT to false on sun.nio.ch.ServerSocketChannelImpl[unbound]

java.lang.UnsupportedOperationException: 'SO_REUSEPORT' not supported

How to resolve this issue?

1

There are 1 answers

0
Joakim Erdfelt On

That is not an error, the message ...

org.eclipse.jetty.server.AbstractConnector - Could not configure SO_REUSEPORT to false on sun.nio.ch.ServerSocketChannelImpl[unbound]

Is a DEBUG level message telling you that your JVM does not support SO_REUSEPORT on that network ...

Example

java.nio.channels.ServerSocketChannel serverSocketChannel = ...;
java.net.SocketOption soReusePortOpt =
    java.net.StandardSocketOptions.SO_REUSEPORT;

serverSocketChannel.setOption(soReusePortOpt, true); // this fails on your JVM

Jetty logs this inability to configure a specific Socket Option at DEBUG level (meaning it is NOT an error). If you are using an OS or a JVM that doesn't support SO_REUSEPORT, then this feature is unavailable to you. If this feature is important to you, then you'll need to you'll need to discover why your OS or JVM doesn't support this feature and address it outside of Jetty.

The majority of folks out there do not need SO_REUSEPORT featureset.

Past issue about this topic on Jetty - https://github.com/eclipse/jetty.project/issues/6661

If you pay attention to DEBUG messages, you'll see many similar attempts to configure various things in a JVM that might fail. If this is logged at DEBUG, then it's just letting you know something optional didn't work against your JVM.

Note: Jetty has 2 places that log at ERROR level (in the XmlParser and SerializedInvoker), no places at FATAL (or above), and all other places are at WARN or below (eg: INFO, DEBUG, TRACE, etc)