tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sandeep Dhameshia <sandeep.dhames...@gmail.com>
Subject Re: websocket: connections not getting closed properly
Date Wed, 21 Jun 2017 04:11:18 GMT
Thanks for your reply Mark,

*log msg*:

Jun 08, 2017 10:13:07 AM
org.apache.tomcat.websocket.server.WsRemoteEndpointImplServer doClose
INFO: Failed to close the ServletOutputStream connection cleanly
java.io.IOException: Broken pipe
at sun.nio.ch.FileDispatcherImpl.write0(Native Method)
at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)
at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
at sun.nio.ch.IOUtil.write(IOUtil.java:51)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:492)
at
org.apache.tomcat.util.net.SecureNioChannel.flush(SecureNioChannel.java:141)
at
org.apache.tomcat.util.net.SecureNioChannel.close(SecureNioChannel.java:385)
at
org.apache.tomcat.util.net.SecureNioChannel.close(SecureNioChannel.java:413)
at
org.apache.coyote.http11.upgrade.NioServletOutputStream.doClose(NioServletOutputStream.java:138)
at
org.apache.coyote.http11.upgrade.AbstractServletOutputStream.close(AbstractServletOutputStream.java:129)
at
org.apache.tomcat.websocket.server.WsRemoteEndpointImplServer.doClose(WsRemoteEndpointImplServer.java:138)
at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.close(WsRemoteEndpointImplBase.java:696)
at
org.apache.tomcat.websocket.server.WsRemoteEndpointImplServer.onWritePossible(WsRemoteEndpointImplServer.java:113)
at
org.apache.tomcat.websocket.server.WsRemoteEndpointImplServer.doWrite(WsRemoteEndpointImplServer.java:81)
at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.writeMessagePart(WsRemoteEndpointImplBase.java:456)
at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessage(WsRemoteEndpointImplBase.java:344)
at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:276)
at
org.apache.tomcat.websocket.WsSession.sendCloseMessage(WsSession.java:559)
at org.apache.tomcat.websocket.WsSession.doClose(WsSession.java:465)
at
org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.onError(WsHttpUpgradeHandler.java:162)
at
org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.access$300(WsHttpUpgradeHandler.java:48)
at
org.apache.tomcat.websocket.server.WsHttpUpgradeHandler$WsReadListener.onError(WsHttpUpgradeHandler.java:230)
at
org.apache.tomcat.websocket.server.WsHttpUpgradeHandler$WsReadListener.onDataAvailable(WsHttpUpgradeHandler.java:213)
at
org.apache.coyote.http11.upgrade.AbstractServletInputStream.onDataAvailable(AbstractServletInputStream.java:203)
at
org.apache.coyote.http11.upgrade.AbstractProcessor.upgradeDispatch(AbstractProcessor.java:93)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:623)
at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1749)
at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1708)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)

*Connector*:

<Connector
           protocol="org.apache.coyote.http11.Http11NioProtocol"
           port="8443" maxThreads="200"
           scheme="https" secure="true" SSLEnabled="true"
           keystoreFile="${catalina.base}/conf/.keystore"
keystorePass="dummy"
           clientAuth="false" sslProtocol="TLS"

ciphers="TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,

TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_RC4_128_SHA,

TLS_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA256,
  TLS_RSA_WITH_AES_256_CBC_SHA,SSL_RSA_WITH_RC4_128_SHA"
  />

regards

On Wed, Jun 21, 2017 at 12:01 AM, Mark Thomas <markt@apache.org> wrote:

> On 20/06/2017 18:48, Sandeep Dhameshia wrote:
> > Hello,
> >
> > I don't know about any format in which I should write this mail, so
> please
> > forgive me if there's any format to follow.
> >
> > I am using v8.0.43 in latest Amazon Linux AMI(2017.03), on m4.large
> > instance. I have deployed modified example Chat application.
> >
> > Everything works fine as expected, but I feel websocket connections are
> not
> > getting closed in some instances. I could see INFO logs from
> > org.apache.tomcat.websocket.server.WsRemoteEndpointImplServer, wrt
> > connection not getting closed cleanly.
>
> Example log messages please.
>
> Connector configuration please.
>
> Mark
>
>
> >
> > I've increased limit for no of files to 65536, both hard and soft limits.
> > Num of connections for NIO connector is set to default.
> >
> > Num of files(sockets) opened are increasing, can see it with  "ls
> > /proc/PID/fd | wc -l".
> >
> > Am I missing any config? I understand some clients are not closing
> > connection properly, but is there any way to handle this properly on
> server
> > side?
> >
> > best regards.
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message