hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeewantha Dharmaparakrama <jeewamp....@gmail.com>
Subject Re: Why is "java.nio.channels.ClosedChannelException" thrown from Nio Reactor?
Date Mon, 19 Aug 2013 08:55:00 GMT
On Mon, Aug 19, 2013 at 2:18 PM, Jeewantha Dharmaparakrama <
jeewamp.dev@gmail.com> wrote:

> Hi All,
>
> I have an intermittent issue with Synapse where it prints the following
> exception in its Error logs.
>
> [2013-08-15 16:57:28,710] ERROR - SourceHandler Unexpected I/O error: java.nio.channels.ClosedChannelException
> java.nio.channels.ClosedChannelException
> at sun.nio.ch.SocketChannelImpl.ensureWriteOpen(SocketChannelImpl.java:135)
> at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:326)
> at org.apache.http.impl.nio.reactor.SessionOutputBufferImpl.flush(SessionOutputBufferImpl.java:167)
> at org.apache.http.impl.nio.DefaultNHttpServerConnection.produceOutput(DefaultNHttpServerConnection.java:323)
> at org.apache.synapse.transport.http.conn.LoggingNHttpServerConnection.produceOutput(LoggingNHttpServerConnection.java:112)
> at org.apache.synapse.transport.passthru.ServerIODispatch.onOutputReady(ServerIODispatch.java:87)
> at org.apache.synapse.transport.passthru.ServerIODispatch.onOutputReady(ServerIODispatch.java:39)
> at org.apache.http.impl.nio.reactor.AbstractIODispatch.outputReady(AbstractIODispatch.java:143)
> at org.apache.http.impl.nio.reactor.BaseIOReactor.writable(BaseIOReactor.java:180)
> at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:342)
> at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:316)
> at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:277)
> at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:105)
> at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:584)
> at java.lang.Thread.run(Thread.java:662)
>
> What happens is for some reason, the corresponding SocketChannel is closed
> but still some IO operation is done on it. Once this exception is caught
> from httpcore-nio, it will be passed to *
> org.apache.http.nio.NHttpServerEventHandler* implementation (*org.apache.synapse.transport.passthru.SourceHandler
> * )
>
*exception(NHttpServerConnection conn, Exception ex) method *

> and will be printed on Synapse Error logs. Since this is an intermittent
> issue,
> I tried to reproduce this programmatically but failed [1]. What can be the
> practical reason for this Error? Can this be deliberately reproduced with
> Synapse?
>
> [1] http://stackoverflow.com/q/18309283/1411653
>
> Thanks in advance,
> Jeewantha.
>

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