users@grizzly.java.net

Re: Errors writing to SSL Socket

From: Oleksiy Stashok <Oleksiy.Stashok_at_Sun.COM>
Date: Thu, 14 Jan 2010 17:28:41 +0100

Hi Brandon,

from the stacktrace it looks like client closes connection and when
server tries to write a data - we see the exception. Not sure it's a
problem on server side at all.
Is it possible to create a standalone testcase, which reproduces the
issue?
Once thing you can try - is to use SSLOutputWriter.flush(...) directly
instead of SSLAsyncWriteQueue, but as I told it may not help, cause
exception doesn't show any problem on server side.

Another thing, which may also help in investigation - is to set
"grizzly" logging level to FINE, this way we will have more info on
incoming SSL packets.

Thanks.

WBR,
Alexey.

On Jan 13, 2010, at 19:34 , bjtb wrote:

>
> Hi Folks
>
> We have a server that sits on the Internet and accepts SSL
> connections from
> client devices. We have about 100 such now and have started to see
> numerous
> exceptions trying to write to the clients. The two exceptions are
> below.
>
> When the device connects to the server I store a record of the
> connection
> (PanelConnection) in a central location (PanelConnectionRegistry).
> At that
> time I create an object (PanelWriter) used to write back to the
> device. When
> I go to write to the device I access PanelWriter. This gets an
> AsyncQueueWriter (CommandServAsyncQueueWriter) from the
> selectorhandler and
> tries to do the write. One question I have is: Is this the best way
> to write
> to the device?
>
> My issue seems similar to
> http://old.nabble.com/SSL-ARP-td18381476.html#a18503031, but I
> wasn't able
> to figure out the resolution in that case.
>
> We are using version 1.9.18.
> http://old.nabble.com/file/p27148803/brivo_grizzly_code.zip
> brivo_grizzly_code.zip
>
> The Grizzly related source is attached. The Controller allocation is
> in
> GrizzlyCommunicationManager.
>
> Thanks for all your help (now and in the past).
>
> Regards
> Brandon
>
> java.nio.channels.ClosedChannelException: null
> sun.nio.ch.SocketChannelImpl.ensureWriteOpen(Unknown Source)
> sun.nio.ch.SocketChannelImpl.write(Unknown Source)
>
> com.sun.grizzly.util.OutputWriter.flushChannel(OutputWriter.java:106)
>
> com.sun.grizzly.util.OutputWriter.flushChannel(OutputWriter.java:74)
>
> com
> .sun.grizzly.util.SSLOutputWriter.flushChannel(SSLOutputWriter.java:
> 100)
>
> com
> .brivo
> .commandserv
> .communication
> .CommandServAsyncQueueWriter
> .doWrite(CommandServAsyncQueueWriter.java:153)
>
> com
> .sun
> .grizzly
> .async
> .AbstractAsyncQueueWriter.doWrite(AbstractAsyncQueueWriter.java:430)
>
> com
> .sun
> .grizzly
> .async.AbstractAsyncQueueWriter.write(AbstractAsyncQueueWriter.java:
> 182)
>
> com
> .sun
> .grizzly.async.TCPAsyncQueueWriter.write(TCPAsyncQueueWriter.java:77)
>
> com
> .sun
> .grizzly
> .async.AbstractAsyncQueueWriter.write(AbstractAsyncQueueWriter.java:
> 140)
>
> com
> .sun
> .grizzly
> .async.AbstractAsyncQueueWriter.write(AbstractAsyncQueueWriter.java:
> 130)
>
> com
> .sun
> .grizzly
> .async.AbstractAsyncQueueWriter.write(AbstractAsyncQueueWriter.java:
> 79)
>
> com
> .brivo
> .commandserv
> .communication
> .CommandServAsyncQueueWriter.write(CommandServAsyncQueueWriter.java:
> 99)
>
> com
> .brivo.commandserv.communication.PanelWriter.write(PanelWriter.java:
> 145)
>
> com
> .brivo
> .commandserv
> .communication.PanelWriter.writeToChannel(PanelWriter.java:101)
>
> com
> .brivo
> .commandserv
> .communication.PanelConnection.writeToChannel(PanelConnection.java:
> 119)
>
> com
> .brivo
> .commandserv
> .communication
> .GrizzlyCommunicationManager
> .sendMessage(GrizzlyCommunicationManager.java:333)
>
> com
> .brivo
> .commandserv
> .heartbeat
> .HeartbeatSendProcessorTaskImpl
> .sendMessageToPanel(HeartbeatSendProcessorTaskImpl.java:92)
>
> com
> .brivo
> .commandserv
> .heartbeat
> .HeartbeatSendProcessorTaskImpl
> .doExecute(HeartbeatSendProcessorTaskImpl.java:71)
>
> com
> .brivo
> .commandserv
> .heartbeat
> .HeartbeatSendProcessorTaskImpl
> .doExecute(HeartbeatSendProcessorTaskImpl.java:32)
>
> com
> .brivo
> .commandserv
> .server.AbstractProcessorTask.call(AbstractProcessorTask.java:62)
> java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
> java.util.concurrent.FutureTask.run(Unknown Source)
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
> Source)
> java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
> Source)
> java.lang.Thread.run(Unknown Source)
>
>
> java.io.IOException: SSLOutputWriter: CLOSED
>
> com
> .sun.grizzly.util.SSLOutputWriter.flushChannel(SSLOutputWriter.java:
> 96)
>
> com
> .brivo
> .commandserv
> .communication
> .CommandServAsyncQueueWriter
> .doWrite(CommandServAsyncQueueWriter.java:153)
>
> com
> .sun
> .grizzly
> .async
> .AbstractAsyncQueueWriter.doWrite(AbstractAsyncQueueWriter.java:430)
>
> com
> .sun
> .grizzly
> .async.AbstractAsyncQueueWriter.write(AbstractAsyncQueueWriter.java:
> 182)
>
> com
> .sun
> .grizzly.async.TCPAsyncQueueWriter.write(TCPAsyncQueueWriter.java:77)
>
> com
> .sun
> .grizzly
> .async.AbstractAsyncQueueWriter.write(AbstractAsyncQueueWriter.java:
> 140)
>
> com
> .sun
> .grizzly
> .async.AbstractAsyncQueueWriter.write(AbstractAsyncQueueWriter.java:
> 130)
>
> com
> .sun
> .grizzly
> .async.AbstractAsyncQueueWriter.write(AbstractAsyncQueueWriter.java:
> 79)
>
> com
> .brivo
> .commandserv
> .communication
> .CommandServAsyncQueueWriter.write(CommandServAsyncQueueWriter.java:
> 99)
>
> com
> .brivo.commandserv.communication.PanelWriter.write(PanelWriter.java:
> 145)
>
> com
> .brivo
> .commandserv
> .communication.PanelWriter.writeToChannel(PanelWriter.java:101)
>
> com
> .brivo
> .commandserv
> .communication.PanelConnection.writeToChannel(PanelConnection.java:
> 119)
>
> com
> .brivo
> .commandserv
> .communication
> .GrizzlyCommunicationManager
> .sendMessage(GrizzlyCommunicationManager.java:333)
>
> com
> .brivo
> .commandserv
> .heartbeat
> .HeartbeatSendProcessorTaskImpl
> .sendMessageToPanel(HeartbeatSendProcessorTaskImpl.java:92)
>
> com
> .brivo
> .commandserv
> .heartbeat
> .HeartbeatSendProcessorTaskImpl
> .doExecute(HeartbeatSendProcessorTaskImpl.java:71)
>
> com
> .brivo
> .commandserv
> .heartbeat
> .HeartbeatSendProcessorTaskImpl
> .doExecute(HeartbeatSendProcessorTaskImpl.java:32)
>
> com
> .brivo
> .commandserv
> .server.AbstractProcessorTask.call(AbstractProcessorTask.java:62)
> java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
> java.util.concurrent.FutureTask.run(Unknown Source)
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
> Source)
> java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
> Source)
> java.lang.Thread.run(Unknown Source)
>
>
>
>
> --
> View this message in context: http://old.nabble.com/Errors-writing-to-SSL-Socket-tp27148803p27148803.html
> Sent from the Grizzly - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>