Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 49960 invoked from network); 17 Aug 2005 01:42:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 17 Aug 2005 01:42:00 -0000 Received: (qmail 21646 invoked by uid 500); 17 Aug 2005 01:41:59 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 21523 invoked by uid 500); 17 Aug 2005 01:41:59 -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 21382 invoked by uid 99); 17 Aug 2005 01:41:58 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Aug 2005 18:41:57 -0700 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 461FBE2 for ; Wed, 17 Aug 2005 03:41:56 +0200 (CEST) Message-ID: <929168033.1124242916285.JavaMail.jira@ajax.apache.org> Date: Wed, 17 Aug 2005 03:41:56 +0200 (CEST) From: "Trustin Lee (JIRA)" To: dev@directory.apache.org Subject: [jira] Updated: (DIRMINA-82) IdleSession reported only once per IO In-Reply-To: <318332631.1124140854550.JavaMail.jira@ajax.apache.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/DIRMINA-82?page=all ] Trustin Lee updated DIRMINA-82: ------------------------------- Fix Version: 0.7.4 > IdleSession reported only once per IO > ------------------------------------- > > Key: DIRMINA-82 > URL: http://issues.apache.org/jira/browse/DIRMINA-82 > Project: Directory MINA > Type: Bug > Versions: 0.7.3 > Reporter: Ash Hornbeck > Assignee: Trustin Lee > Fix For: 0.7.4 > > IdleSession reported only once per IO > For example, if I do something like this > // session is a ProtocolSession from an IoProtocolConnector > session.getConfig().setIdleTime(IdleStatus.BOTH_IDLE,30 ); > and a connection is idle for 301 seconds (both read and write), I expect roughly 10 IdleStatus.BOTH_IDLE events. In 0.7.3 it will only be fired once and only once until IO occurs. It looks like it is due to the way idle sessions are detected in the following: > SocketIoProcessor.java: > private void notifyIdleSession0( SocketSession session, long currentTime, > long idleTime, IdleStatus status, > long lastIoTime ) > { > if( idleTime > 0 && !session.isIdle( status ) && lastIoTime != 0 > && ( currentTime - lastIoTime ) >= idleTime ) > { > session.setIdle( status, true ); > session.getManagerFilterChain().sessionIdle( session, status ); > } > } > Please correct me if I am wrong but it looks as though the statement in the if clause, !session.isIdle( status ), is used to detect if the idle event has been fired. This prevents multiple session idle events from being fired due to selector timeouts in Worker.run(). > The problem is that using this method there is no way to know that the last idle event was fired greater than idle timeout seconds ago and another event needs to be fired. > My suggestion is to add lastIdleEventForBoth/Read/Write and replace !session.isIdle( status) with (currentTime ? lastIdleEvent) >= idleTime. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira