https://bz.apache.org/bugzilla/show_bug.cgi?id=63568
Bug ID: 63568
Summary: Allow keeping tcpNoDelay untouched (default)
Product: Tomcat 9
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Catalina
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: -----
Created attachment 36661
--> https://bz.apache.org/bugzilla/attachment.cgi?id=36661&action=edit
hotfix to enable Tomcat listening on an inherited unix domain socket
Hello,
I got this error when new HTTP request comes:
14-Jul-2019 18:18:39.296 SEVERE [http-nio-8080-Acceptor]
org.apache.tomcat.util.net.NioEndpoint.setSocketOptions Error setting socket
options
java.net.SocketException: Operace není podporována
at sun.nio.ch.Net.setIntOption0(Native Method)
at sun.nio.ch.Net.setSocketOption(Net.java:334)
at
sun.nio.ch.SocketChannelImpl.setOption(SocketChannelImpl.java:190)
at
sun.nio.ch.SocketAdaptor.setBooleanOption(SocketAdaptor.java:271)
at
sun.nio.ch.SocketAdaptor.setTcpNoDelay(SocketAdaptor.java:306)
at
org.apache.tomcat.util.net.SocketProperties.setProperties(SocketProperties.java:204)
at
org.apache.tomcat.util.net.NioEndpoint.setSocketOptions(NioEndpoint.java:401)
at
org.apache.tomcat.util.net.NioEndpoint.setSocketOptions(NioEndpoint.java:73)
at org.apache.tomcat.util.net.Acceptor.run(Acceptor.java:115)
at java.lang.Thread.run(Thread.java:748)
do not panic, this does not happen in normal conditions - my setup is kind of
special. Given socket does not support the tcpNoDelay option, so it throws an
exception. To get rid of it, I patched the Tomcat's source code (see
attachment, it patches the latest git version).
I am looking for a more clean solution that could be merged in the official
sources. I suggest adding a third option in the tcpNoDelay configuration
<https://tomcat.apache.org/tomcat-9.0-doc/config/http.html> like "default" or
"null" besides the "true" and "false" (i.e. convert some booleans to Booleans
in the source code and allow the null value) which will cause that
setTcpNoDelay() method will not be called on new incomming connections/sockets.
Please confirm whether this is a good solution – I will then write a new patch.
Original mailing list thread:
<http://tomcat.10.x6.nabble.com/Allow-keeping-tcpNoDelay-untouched-default-td5087592.html>
Context: I am interested in making applications listen on unix domain sockets
instead of TCP ones (e.g. Jetty can work this way) and especially in listening
on sockets inherited from parent process (the "useInheritedChannel" in Tomcat's
Connector configuration). And unix domain socket has no tcpNoDelay option
obviously.
Franta
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]