directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rodrigo Kumpera <kump...@gmail.com>
Subject [mina] Problems with SocketIoProcessor and IoThreadPoolFilter
Date Fri, 12 Aug 2005 15:50:36 GMT
Hi,

Great work with mina, it do makes writting nio servers easy. I´m
writing a filtering server and have the following scenario:

1-incoming connections, using ServiceRegistry with IoHandler.
2-filtering is done in a separate pool (using doug lea's
util.concurrent package)
3-fowarding the result to another server, using SocketIoProcessor and
IoThreadPoolFilter.

So fair I´ve been able to fine tune the thread pool used by the
ServiceRegistry (1).

My problem is with (2) and (3), I want to have a single thread pool to
be shared by the 3 stages of the server.
With the filtering stage I´m thinking about playing with 
IoThreadPoolFilter implementation to use util.concurrent and expose
it's interface.
My problem when using a thread pool with the last stage, when
connecting to foreign hosts, is that it throws the following exception
under moderate load:

java.nio.channels.CancelledKeyException
        at sun.nio.ch.SelectionKeyImpl.ensureValid(SelectionKeyImpl.java:55)
        at sun.nio.ch.SelectionKeyImpl.interestOps(SelectionKeyImpl.java:59)
        at org.apache.mina.io.socket.SocketIoProcessor.flush(SocketIoProcessor.j
ava:511)
        at org.apache.mina.io.socket.SocketIoProcessor.flushSessions(SocketIoPro
cessor.java:422)
        at org.apache.mina.io.socket.SocketIoProcessor.access$300(SocketIoProces
sor.java:41)
        at org.apache.mina.io.socket.SocketIoProcessor$Worker.run(SocketIoProces
sor.java:546)

I tried to use the same IoThreadPoolFilter with an instance of
SocketIoProcessor and ServiceRegistry, but it doesn´t seen to work,
the server halts and don't make any progress.

Should I fill jira issues about these two problems?

Thank you very much,


Rodrigo Kumpera

Mime
View raw message