Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClosedChannelException from jetty-test-webapp javax websocket chat example #3849

Closed
gregw opened this issue Jul 3, 2019 · 5 comments
Closed
Assignees

Comments

@gregw
Copy link
Contributor

gregw commented Jul 3, 2019

2019-07-03 11:10:50.605:WARN:ca.JavaxWebSocketChat:qtp1008925772-21: Unhandled Error: com.acme.JavaxWebSocketChat@4ffed5b2
java.nio.channels.ClosedChannelException
	at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession.closeConnection(WebSocketCoreSession.java:332)
	at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession.lambda$sendFrame$3(WebSocketCoreSession.java:531)
	at org.eclipse.jetty.util.Callback$3.succeeded(Callback.java:129)
	at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession$Flusher.succeeded(WebSocketCoreSession.java:818)
	at org.eclipse.jetty.websocket.core.internal.compress.CompressExtension.notifyCallbackSuccess(CompressExtension.java:258)
	at org.eclipse.jetty.websocket.core.internal.compress.CompressExtension$Flusher.succeeded(CompressExtension.java:405)
	at org.eclipse.jetty.websocket.core.internal.FrameFlusher.notifyCallbackSuccess(FrameFlusher.java:410)
	at org.eclipse.jetty.websocket.core.internal.FrameFlusher.process(FrameFlusher.java:274)
	at org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:241)
	at org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:223)
	at org.eclipse.jetty.websocket.core.internal.WebSocketConnection.enqueueFrame(WebSocketConnection.java:567)
	at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession$OutgoingAdaptor.sendFrame(WebSocketCoreSession.java:721)
	at org.eclipse.jetty.websocket.core.AbstractExtension.nextOutgoingFrame(AbstractExtension.java:128)
	at org.eclipse.jetty.websocket.core.internal.compress.PerMessageDeflateExtension.nextOutgoingFrame(PerMessageDeflateExtension.java:131)
	at org.eclipse.jetty.websocket.core.internal.compress.CompressExtension.access$000(CompressExtension.java:41)
	at org.eclipse.jetty.websocket.core.internal.compress.CompressExtension$Flusher.deflate(CompressExtension.java:444)
	at org.eclipse.jetty.websocket.core.internal.compress.CompressExtension$Flusher.process(CompressExtension.java:428)
	at org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:241)
	at org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:223)
	at org.eclipse.jetty.websocket.core.internal.compress.CompressExtension.sendFrame(CompressExtension.java:234)
	at org.eclipse.jetty.websocket.core.internal.ExtensionStack.sendFrame(ExtensionStack.java:239)
	at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession$Flusher.process(WebSocketCoreSession.java:811)
	at org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:241)
	at org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:223)
	at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession.sendFrame(WebSocketCoreSession.java:541)
	at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession.close(WebSocketCoreSession.java:289)
	at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession$IncomingAdaptor.lambda$onFrame$1(WebSocketCoreSession.java:695)
	at org.eclipse.jetty.util.Callback$3.succeeded(Callback.java:129)
	at org.eclipse.jetty.websocket.javax.common.JavaxWebSocketFrameHandler.onClose(JavaxWebSocketFrameHandler.java:539)
	at org.eclipse.jetty.websocket.javax.common.JavaxWebSocketFrameHandler.onFrame(JavaxWebSocketFrameHandler.java:232)
	at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession$IncomingAdaptor.onFrame(WebSocketCoreSession.java:705)
	at org.eclipse.jetty.websocket.core.AbstractExtension.nextIncomingFrame(AbstractExtension.java:122)
	at org.eclipse.jetty.websocket.core.internal.compress.PerMessageDeflateExtension.nextIncomingFrame(PerMessageDeflateExtension.java:120)
	at org.eclipse.jetty.websocket.core.internal.compress.PerMessageDeflateExtension.onFrame(PerMessageDeflateExtension.java:81)
	at org.eclipse.jetty.websocket.core.internal.ExtensionStack.onFrame(ExtensionStack.java:108)
	at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession.onFrame(WebSocketCoreSession.java:501)
	at org.eclipse.jetty.websocket.core.internal.WebSocketConnection.onFrame(WebSocketConnection.java:188)
	at org.eclipse.jetty.websocket.core.internal.WebSocketConnection.fillAndParse(WebSocketConnection.java:380)
	at org.eclipse.jetty.websocket.core.internal.WebSocketConnection.onFillable(WebSocketConnection.java:264)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:315)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:782)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:908)
	at java.base/java.lang.Thread.run(Thread.java:834)
@lachlan-roberts
Copy link
Contributor

@gregw
I would say you closed the client window without gracefully closing the connection, the client sends SHUTDOWN status code, which is classified as an abnormal status code so it reports this as an error

this should be an error at this point because if we had any frames waiting to send in the FrameFlusher the SHUTDOWN would jump the queue and cancel them

@gregw
Copy link
Contributor Author

gregw commented Jul 4, 2019

@lachlan-roberts If you just run the demo, start a chat and then hit the back button on the browser, we get this exception. So that is not abnormal, that is normal usage!!!
So we can't have a situation where every browser leaving a chat causes such an exception. Hopefully this is just the demo logging the error - in which case it shouldn't, or perhaps it is trying to talk to the client as it leaves? Whatever... can you look at this and make sure that this normal situation is handled gracefully

@lachlan-roberts
Copy link
Contributor

@gregw do you think the behaviour should be changed in some way, or that there should be an error handler so no stack traces are being printed out

@gregw
Copy link
Contributor Author

gregw commented Jul 4, 2019

If we receive a Close(SHUTDOWN), I don't see why we are calling onError? Surely calling onClose is enough?

lachlan-roberts added a commit that referenced this issue Jul 5, 2019
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
lachlan-roberts added a commit that referenced this issue Jul 6, 2019
…malClose

Issue #3849 - only notify onError for local errors
@lachlan-roberts
Copy link
Contributor

fixed in #3853

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants