[TYRUS-198] Implement TyrusHttpUpgradeHandler#destroy() Created: 17/Jun/13  Updated: 26/Jun/13  Resolved: 26/Jun/13

Status: Resolved
Project: tyrus
Component/s: None
Affects Version/s: None
Fix Version/s: 1.1

Type: Bug Priority: Major
Reporter: jitu Assignee: Pavel Bucek
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

I guess that's the way to find out client disconnects(HttpUpgradeHandler#destroy() specifies about client disconnects) in servlet container



 Comments   
Comment by Pavel Bucek [ 17/Jun/13 ]

seems like duplicate of TYRUS-175.. can you please confirm? (maybe close this one and add comment to TYRUS-175?)

Comment by jitu [ 17/Jun/13 ]

TYRUS-175 claims that close frame is sent, but still @OnClose method is not called (but not sure whether it is received by the server). In that sense, it seems to be different.

Comment by Pavel Bucek [ 18/Jun/13 ]

well, destroy is sometimes called. Unfortunately, it does not seem to be reliable.

When I close browser tab (connection is interrupted), TyrusUpgradeHandler#onError is called with NPE:

[2013-06-18T18:07:51.238+0200] [glassfish 4.0] [SEVERE] [] [] [tid: _ThreadID=29 _ThreadName=Thread-8] [timeMillis: 1371571671238] [levelValue: 1000] [[
  java.lang.NullPointerException
	at org.apache.catalina.connector.InputBuffer.isReady(InputBuffer.java:281)
	at org.apache.catalina.connector.CoyoteInputStream.isReady(CoyoteInputStream.java:299)
	at org.glassfish.tyrus.servlet.TyrusHttpUpgradeHandler.onDataAvailable(TyrusHttpUpgradeHandler.java:140)
	at org.apache.catalina.connector.InputBuffer$ReadHandlerImpl.processDataAvailable(InputBuffer.java:488)
	at org.apache.catalina.connector.InputBuffer$ReadHandlerImpl.onDataAvailable(InputBuffer.java:453)
	at org.glassfish.grizzly.http.io.InputBuffer.append(InputBuffer.java:855)
	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:220)
	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:837)
	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
	at java.lang.Thread.run(Thread.java:722)]]

line 140 in TyrusUpgradeHandler is servletInputStream.isReady() call.. seems like a bug in servlet impl? Jitu, do you have any comments/insight?

Comment by jitu [ 18/Jun/13 ]

I also think that it is servlet container's issue esp grizzly is detecting and informing about disconnect. Adding Shing Wai to the watcher's list.

Comment by Pavel Bucek [ 26/Jun/13 ]

fixed in the trunk (rev 691)

Generated at Fri Aug 28 01:03:13 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.