Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 29539 invoked from network); 12 Aug 2005 15:50:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 12 Aug 2005 15:50:40 -0000 Received: (qmail 50641 invoked by uid 500); 12 Aug 2005 15:50:39 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 50544 invoked by uid 500); 12 Aug 2005 15:50:38 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 50531 invoked by uid 99); 12 Aug 2005 15:50:38 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Aug 2005 08:50:38 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of kumpera@gmail.com designates 64.233.170.204 as permitted sender) Received: from [64.233.170.204] (HELO rproxy.gmail.com) (64.233.170.204) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Aug 2005 08:50:59 -0700 Received: by rproxy.gmail.com with SMTP id r35so522404rna for ; Fri, 12 Aug 2005 08:50:36 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=tnhBX0qJMPIRfgGV4G125yIDPxRM+t8cKtitEEdDmc+/riPGdOwBwPwTlwsBYDQTOGssbmCRijbvdyKeGofmmbChCVQwQryor5psfh1WhYSo/GVVH00Vq174OJ0E3f/k5XrQ8p0ULGji+cJvW43OU1f4Oul3Ye191TbSHp0P9Io= Received: by 10.38.59.29 with SMTP id h29mr1089194rna; Fri, 12 Aug 2005 08:50:36 -0700 (PDT) Received: by 10.38.90.2 with HTTP; Fri, 12 Aug 2005 08:50:36 -0700 (PDT) Message-ID: <8cca42d805081208507a108c66@mail.gmail.com> Date: Fri, 12 Aug 2005 12:50:36 -0300 From: Rodrigo Kumpera To: dev@directory.apache.org Subject: [mina] Problems with SocketIoProcessor and IoThreadPoolFilter Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi, Great work with mina, it do makes writting nio servers easy. I=B4m 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=B4ve 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=B4m thinking about playing with=20 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(SocketIoProces= sor.j ava:511) at org.apache.mina.io.socket.SocketIoProcessor.flushSessions(Socket= IoPro cessor.java:422) at org.apache.mina.io.socket.SocketIoProcessor.access$300(SocketIoP= roces sor.java:41) at org.apache.mina.io.socket.SocketIoProcessor$Worker.run(SocketIoP= roces sor.java:546) I tried to use the same IoThreadPoolFilter with an instance of SocketIoProcessor and ServiceRegistry, but it doesn=B4t 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