Bug 59253 - IOExceptions in websockets
Summary: IOExceptions in websockets
Status: RESOLVED WONTFIX
Alias: None
Product: Tomcat 8
Classification: Unclassified
Component: WebSocket (show other bugs)
Version: 8.0.33
Hardware: All Linux
: P2 enhancement (vote)
Target Milestone: ----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-30 18:21 UTC by Steve Demy
Modified: 2016-06-15 14:01 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Demy 2016-03-30 18:21:12 UTC
Environment 
Linux:     GNU/Linux 3.13.0-83-generic x86_64
Java:      build 1.8.0_77-b03 Oracle
Tomcat:    Tomcat 8.0.33
Framework: Vaadin 7.6.4
APR:       Apache Tomcat Native library 1.2.5 using APR version 1.5.2
Connector:
    <Connector port="28080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               compression="on"
               compressionMinSize="512"
               compressableMimeType="text/html,text/xml,text/plain,text/css,text/javascript,application/javascript,application/json,image/svg+xml" />


Description: The following stack traces are generated.  There are no user complaints - I suspect these are generated when the UI closes.  While bug 59014 has eliminated a large number of similar stack traces, these persist.  Same problem in another location?  I lack the skill for further analysis.


Mar 30, 2016 8:28:01 AM org.atmosphere.container.JSR356Endpoint onError
SEVERE: 
java.io.IOException: Unexpected error [32] writing data to the APR/native socket [139,838,766,510,368] with wrapper [org.apache.tomcat.util.net.AprEndpoint$AprSocketWrapper@234a04d6:139838766510368].
	at org.apache.coyote.http11.upgrade.AprServletOutputStream.doWriteInternal(AprServletOutputStream.java:142)
	at org.apache.coyote.http11.upgrade.AprServletOutputStream.doWrite(AprServletOutputStream.java:68)
	at org.apache.coyote.http11.upgrade.AbstractServletOutputStream.writeInternal(AbstractServletOutputStream.java:165)
	at org.apache.coyote.http11.upgrade.AbstractServletOutputStream.write(AbstractServletOutputStream.java:132)
	at org.apache.tomcat.websocket.server.WsRemoteEndpointImplServer.onWritePossible(WsRemoteEndpointImplServer.java:98)
	at org.apache.tomcat.websocket.server.WsRemoteEndpointImplServer.doWrite(WsRemoteEndpointImplServer.java:79)
	at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.writeMessagePart(WsRemoteEndpointImplBase.java:453)
	at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessage(WsRemoteEndpointImplBase.java:341)
	at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:273)
	at org.apache.tomcat.websocket.WsSession.sendCloseMessage(WsSession.java:587)
	at org.apache.tomcat.websocket.WsSession.doClose(WsSession.java:489)
	at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.onError(WsHttpUpgradeHandler.java:150)
	at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.access$300(WsHttpUpgradeHandler.java:48)
	at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler$WsReadListener.onError(WsHttpUpgradeHandler.java:211)
	at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler$WsReadListener.onDataAvailable(WsHttpUpgradeHandler.java:194)
	at org.apache.coyote.http11.upgrade.AbstractServletInputStream.onDataAvailable(AbstractServletInputStream.java:198)
	at org.apache.coyote.http11.upgrade.AbstractProcessor.upgradeDispatch(AbstractProcessor.java:96)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:647)
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2500)
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2489)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)

Mar 30, 2016 8:28:01 AM org.atmosphere.container.JSR356Endpoint onError
SEVERE: 
java.io.IOException: Unexpected error [104] reading data from the APR/native socket [139,838,766,510,368] with wrapper [org.apache.tomcat.util.net.AprEndpoint$AprSocketWrapper@234a04d6:139838766510368].
	at org.apache.coyote.http11.upgrade.AprServletInputStream.doRead(AprServletInputStream.java:133)
	at org.apache.coyote.http11.upgrade.AbstractServletInputStream.read(AbstractServletInputStream.java:124)
	at org.apache.tomcat.websocket.server.WsFrameServer.onDataAvailable(WsFrameServer.java:60)
	at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler$WsReadListener.onDataAvailable(WsHttpUpgradeHandler.java:186)
	at org.apache.coyote.http11.upgrade.AbstractServletInputStream.onDataAvailable(AbstractServletInputStream.java:198)
	at org.apache.coyote.http11.upgrade.AbstractProcessor.upgradeDispatch(AbstractProcessor.java:96)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:647)
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2500)
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2489)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)

Mar 30, 2016 8:28:33 AM org.atmosphere.container.JSR356Endpoint onError
SEVERE: 
java.io.IOException: Unexpected error [32] writing data to the APR/native socket [139,838,766,626,368] with wrapper [org.apache.tomcat.util.net.AprEndpoint$AprSocketWrapper@1fffe750:139838766626368].
	at org.apache.coyote.http11.upgrade.AprServletOutputStream.doWriteInternal(AprServletOutputStream.java:142)
	at org.apache.coyote.http11.upgrade.AprServletOutputStream.doWrite(AprServletOutputStream.java:68)
	at org.apache.coyote.http11.upgrade.AbstractServletOutputStream.writeInternal(AbstractServletOutputStream.java:165)
	at org.apache.coyote.http11.upgrade.AbstractServletOutputStream.write(AbstractServletOutputStream.java:132)
	at org.apache.tomcat.websocket.server.WsRemoteEndpointImplServer.onWritePossible(WsRemoteEndpointImplServer.java:98)
	at org.apache.tomcat.websocket.server.WsRemoteEndpointImplServer.doWrite(WsRemoteEndpointImplServer.java:79)
	at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.writeMessagePart(WsRemoteEndpointImplBase.java:453)
	at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessage(WsRemoteEndpointImplBase.java:341)
	at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:273)
	at org.apache.tomcat.websocket.WsSession.sendCloseMessage(WsSession.java:587)
	at org.apache.tomcat.websocket.WsSession.doClose(WsSession.java:489)
	at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.onError(WsHttpUpgradeHandler.java:150)
	at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.access$300(WsHttpUpgradeHandler.java:48)
	at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler$WsReadListener.onError(WsHttpUpgradeHandler.java:211)
	at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler$WsReadListener.onDataAvailable(WsHttpUpgradeHandler.java:194)
	at org.apache.coyote.http11.upgrade.AbstractServletInputStream.onDataAvailable(AbstractServletInputStream.java:198)
	at org.apache.coyote.http11.upgrade.AbstractProcessor.upgradeDispatch(AbstractProcessor.java:96)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:647)
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2500)
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2489)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)

Mar 30, 2016 8:28:33 AM com.vaadin.server.communication.PushHandler connectionLost
INFO: No UI was found based on data in the request, but a slower lookup based on the AtmosphereResource succeeded. See http://dev.vaadin.com/ticket/14251 for more details.
Mar 30, 2016 8:28:33 AM org.atmosphere.container.JSR356Endpoint onError
SEVERE: 
java.io.IOException: Unexpected error [104] reading data from the APR/native socket [139,838,766,626,368] with wrapper [org.apache.tomcat.util.net.AprEndpoint$AprSocketWrapper@1fffe750:139838766626368].
	at org.apache.coyote.http11.upgrade.AprServletInputStream.doRead(AprServletInputStream.java:133)
	at org.apache.coyote.http11.upgrade.AbstractServletInputStream.read(AbstractServletInputStream.java:124)
	at org.apache.tomcat.websocket.server.WsFrameServer.onDataAvailable(WsFrameServer.java:60)
	at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler$WsReadListener.onDataAvailable(WsHttpUpgradeHandler.java:186)
	at org.apache.coyote.http11.upgrade.AbstractServletInputStream.onDataAvailable(AbstractServletInputStream.java:198)
	at org.apache.coyote.http11.upgrade.AbstractProcessor.upgradeDispatch(AbstractProcessor.java:96)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:647)
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2500)
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2489)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)

Mar 30, 2016 8:29:40 AM com.vaadin.server.communication.PushHandler connectionLost
INFO: No UI was found based on data in the request, but a slower lookup based on the AtmosphereResource succeeded. See http://dev.vaadin.com/ticket/14251 for more details.
Mar 30, 2016 8:35:41 AM com.vaadin.server.GlobalResourceHandler error
WARNING: Global resource legacy/6/WB_Graphic349204598_22.svg not found
Mar 30, 2016 9:05:06 AM org.atmosphere.container.JSR356Endpoint onError
SEVERE: 
java.io.IOException: Unexpected error [32] writing data to the APR/native socket [139,838,766,510,368] with wrapper [org.apache.tomcat.util.net.AprEndpoint$AprSocketWrapper@17037e02:139838766510368].
	at org.apache.coyote.http11.upgrade.AprServletOutputStream.doWriteInternal(AprServletOutputStream.java:142)
	at org.apache.coyote.http11.upgrade.AprServletOutputStream.doWrite(AprServletOutputStream.java:68)
	at org.apache.coyote.http11.upgrade.AbstractServletOutputStream.writeInternal(AbstractServletOutputStream.java:165)
	at org.apache.coyote.http11.upgrade.AbstractServletOutputStream.write(AbstractServletOutputStream.java:132)
	at org.apache.tomcat.websocket.server.WsRemoteEndpointImplServer.onWritePossible(WsRemoteEndpointImplServer.java:98)
	at org.apache.tomcat.websocket.server.WsRemoteEndpointImplServer.doWrite(WsRemoteEndpointImplServer.java:79)
	at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.writeMessagePart(WsRemoteEndpointImplBase.java:453)
	at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessage(WsRemoteEndpointImplBase.java:341)
	at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:273)
	at org.apache.tomcat.websocket.WsSession.sendCloseMessage(WsSession.java:587)
	at org.apache.tomcat.websocket.WsSession.doClose(WsSession.java:489)
	at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.onError(WsHttpUpgradeHandler.java:150)
	at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.access$300(WsHttpUpgradeHandler.java:48)
	at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler$WsReadListener.onError(WsHttpUpgradeHandler.java:211)
	at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler$WsReadListener.onDataAvailable(WsHttpUpgradeHandler.java:194)
	at org.apache.coyote.http11.upgrade.AbstractServletInputStream.onDataAvailable(AbstractServletInputStream.java:198)
	at org.apache.coyote.http11.upgrade.AbstractProcessor.upgradeDispatch(AbstractProcessor.java:96)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:647)
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2500)
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2489)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)

Mar 30, 2016 9:05:06 AM com.vaadin.server.communication.PushHandler connectionLost
INFO: No UI was found based on data in the request, but a slower lookup based on the AtmosphereResource succeeded. See http://dev.vaadin.com/ticket/14251 for more details.
Mar 30, 2016 9:05:06 AM org.atmosphere.container.JSR356Endpoint onError
SEVERE: 
java.io.IOException: Unexpected error [113] reading data from the APR/native socket [139,838,766,510,368] with wrapper [org.apache.tomcat.util.net.AprEndpoint$AprSocketWrapper@17037e02:139838766510368].
	at org.apache.coyote.http11.upgrade.AprServletInputStream.doRead(AprServletInputStream.java:133)
	at org.apache.coyote.http11.upgrade.AbstractServletInputStream.read(AbstractServletInputStream.java:124)
	at org.apache.tomcat.websocket.server.WsFrameServer.onDataAvailable(WsFrameServer.java:60)
	at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler$WsReadListener.onDataAvailable(WsHttpUpgradeHandler.java:186)
	at org.apache.coyote.http11.upgrade.AbstractServletInputStream.onDataAvailable(AbstractServletInputStream.java:198)
	at org.apache.coyote.http11.upgrade.AbstractProcessor.upgradeDispatch(AbstractProcessor.java:96)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:647)
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2500)
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2489)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)

Mar 30, 2016 9:52:30 AM org.atmosphere.container.JSR356Endpoint onError
SEVERE: 
java.io.IOException: Unexpected error [32] writing data to the APR/native socket [139,838,766,593,536] with wrapper [org.apache.tomcat.util.net.AprEndpoint$AprSocketWrapper@6ffa76fd:139838766593536].
	at org.apache.coyote.http11.upgrade.AprServletOutputStream.doWriteInternal(AprServletOutputStream.java:142)
	at org.apache.coyote.http11.upgrade.AprServletOutputStream.doWrite(AprServletOutputStream.java:68)
	at org.apache.coyote.http11.upgrade.AbstractServletOutputStream.writeInternal(AbstractServletOutputStream.java:165)
	at org.apache.coyote.http11.upgrade.AbstractServletOutputStream.write(AbstractServletOutputStream.java:132)
	at org.apache.tomcat.websocket.server.WsRemoteEndpointImplServer.onWritePossible(WsRemoteEndpointImplServer.java:98)
	at org.apache.tomcat.websocket.server.WsRemoteEndpointImplServer.doWrite(WsRemoteEndpointImplServer.java:79)
	at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.writeMessagePart(WsRemoteEndpointImplBase.java:453)
	at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessage(WsRemoteEndpointImplBase.java:341)
	at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:273)
	at org.apache.tomcat.websocket.WsSession.sendCloseMessage(WsSession.java:587)
	at org.apache.tomcat.websocket.WsSession.doClose(WsSession.java:489)
	at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.onError(WsHttpUpgradeHandler.java:150)
	at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.access$300(WsHttpUpgradeHandler.java:48)
	at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler$WsReadListener.onError(WsHttpUpgradeHandler.java:211)
	at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler$WsReadListener.onDataAvailable(WsHttpUpgradeHandler.java:194)
	at org.apache.coyote.http11.upgrade.AbstractServletInputStream.onDataAvailable(AbstractServletInputStream.java:198)
	at org.apache.coyote.http11.upgrade.AbstractProcessor.upgradeDispatch(AbstractProcessor.java:96)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:647)
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2500)
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2489)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)

Mar 30, 2016 9:52:30 AM com.vaadin.server.communication.PushHandler connectionLost
INFO: No UI was found based on data in the request, but a slower lookup based on the AtmosphereResource succeeded. See http://dev.vaadin.com/ticket/14251 for more details.
Mar 30, 2016 9:52:30 AM org.atmosphere.container.JSR356Endpoint onError
SEVERE: 
java.io.IOException: Unexpected error [113] reading data from the APR/native socket [139,838,766,593,536] with wrapper [org.apache.tomcat.util.net.AprEndpoint$AprSocketWrapper@6ffa76fd:139838766593536].
	at org.apache.coyote.http11.upgrade.AprServletInputStream.doRead(AprServletInputStream.java:133)
	at org.apache.coyote.http11.upgrade.AbstractServletInputStream.read(AbstractServletInputStream.java:124)
	at org.apache.tomcat.websocket.server.WsFrameServer.onDataAvailable(WsFrameServer.java:60)
	at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler$WsReadListener.onDataAvailable(WsHttpUpgradeHandler.java:186)
	at org.apache.coyote.http11.upgrade.AbstractServletInputStream.onDataAvailable(AbstractServletInputStream.java:198)
	at org.apache.coyote.http11.upgrade.AbstractProcessor.upgradeDispatch(AbstractProcessor.java:96)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:647)
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2500)
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2489)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)
Comment 1 Remy Maucherat 2016-03-31 22:56:54 UTC
Some IO errors are considered "normal" and will be returned as an EOF (= the code returns -1). But the APR error code has to match, and here the 32, 104 and 113 are not in that category so they get a more general IOException.

I failed to find what these codes correspond to.
Comment 2 jfclere 2016-04-01 15:46:53 UTC
32, 104 and 113 are errno on linux
#define EPIPE       32  /* Broken pipe */
#define ECONNRESET  104 /* Connection reset by peer */
#define EHOSTUNREACH    113 /* No route to host */
Comment 3 Remy Maucherat 2016-04-01 16:21:13 UTC
The exception catch strategy is different in websockets (the servlet container is more complex and catches and routes all these exceptions). Nothing seems abnormal to me at this point, so it could be an enhancement.
Comment 4 Christopher Schultz 2016-04-07 21:09:29 UTC
(In reply to jfclere from comment #2)
> 32, 104 and 113 are errno on linux
> #define EPIPE       32  /* Broken pipe */
> #define ECONNRESET  104 /* Connection reset by peer */
> #define EHOSTUNREACH    113 /* No route to host */

If you are fortunate enough to have perror (binary) available, it will tell you that as well, including what kind of error code it is.

$ perror 32 104 113
OS error code  32:  Broken pipe
OS error code 104:  Connection reset by peer
OS error code 113:  No route to host

(In reply to Remy Maucherat from comment #3)
> The exception catch strategy is different in websockets (the servlet
> container is more complex and catches and routes all these exceptions).
> Nothing seems abnormal to me at this point, so it could be an enhancement.

"Broken pipe" and "Connection reset" seem like normal "client disappeared" situations where handling it like EOF is probably just fine. That last one -- "No route to host" -- is a little weird. Does that happen when there is a network problem while trying to send bytes down an established channel? I've never seen that error during a conversation... only during an initial connection (attempt).
Comment 5 Steve Demy 2016-04-08 10:37:20 UTC
I believe the stack traces are generated from users connected by mobile devices (Vaadin Touchkit).  These users connect to the LAN using wi-fi and may possibly exit and re-enter areas of coverage or change zones within a coverage area. Many sessions don't generate any errors.  As far as I can tell from casual observation of past behaviour: 1)  Use of NIO or NIO2 connectors makes no difference - a corresponding error is produced, 2)  I tend to see the logs clean after a full system reboot, then errors increase over subsequent days.  The system is dedicated to this one webapp and its few supporting applications and is lightly loaded.  I use a cron script to restart Tomcat nightly in an effort to ensure that no memory leaks etc. accumulate.
Comment 6 Steve Demy 2016-04-08 10:57:49 UTC
I believe the stack traces are generated from users connected by mobile devices (Vaadin Touchkit).  These users connect to the LAN using wi-fi and may possibly exit and re-enter areas of coverage or change zones within a coverage area. Many sessions don't generate any errors.

Now I have found a way to repeatably reproduce a similar stack trace on my OSX development system which uses a NIO connector:  I log into a mobile UI using a Widows phone then push the "back" button (left arrow on bottom of phone) which quits the client browser and generates:

Apr 08, 2016 3:39:53 AM org.atmosphere.container.JSR356Endpoint onError
SEVERE: 
java.io.IOException: Connection reset by peer
	at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
	at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
	at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
	at sun.nio.ch.IOUtil.read(IOUtil.java:197)
	at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
	at org.apache.tomcat.util.net.NioChannel.read(NioChannel.java:137)
	at org.apache.coyote.http11.upgrade.NioServletInputStream.fillReadBuffer(NioServletInputStream.java:136)
	at org.apache.coyote.http11.upgrade.NioServletInputStream.doRead(NioServletInputStream.java:80)
	at org.apache.coyote.http11.upgrade.AbstractServletInputStream.read(AbstractServletInputStream.java:124)
	at org.apache.tomcat.websocket.server.WsFrameServer.onDataAvailable(WsFrameServer.java:60)
	at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler$WsReadListener.onDataAvailable(WsHttpUpgradeHandler.java:186)
	at org.apache.coyote.http11.upgrade.AbstractServletInputStream.onDataAvailable(AbstractServletInputStream.java:198)
	at org.apache.coyote.http11.upgrade.AbstractProcessor.upgradeDispatch(AbstractProcessor.java:96)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:647)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1502)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1458)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)

As said, there is no user impact - the quit appears to work as directed and logging on again is always successful.  This stack trace is of concern only in that it seems a little uncontrolled even for an unplanned disconnect and I wonder if any resources are leaked or hung.
Comment 7 Mark Thomas 2016-06-15 14:01:35 UTC
Tomcat is correctly calling onError when something goes wrong. It appears from the stack traces that it is Atmosphere that is logging the stack traces, not Tomcat. While Tomcat could filter the calls to onError(), I don't think it should. The application may well wish to be informed of unexpected client disconnects.