From dev-return-33567-archive-asf-public=cust-asf.ponee.io@mina.apache.org Tue Oct 2 02:08:05 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 1D455180660 for ; Tue, 2 Oct 2018 02:08:04 +0200 (CEST) Received: (qmail 76855 invoked by uid 500); 2 Oct 2018 00:08:04 -0000 Mailing-List: contact dev-help@mina.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@mina.apache.org Delivered-To: mailing list dev@mina.apache.org Received: (qmail 76844 invoked by uid 99); 2 Oct 2018 00:08:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Oct 2018 00:08:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id A5DF01807E8 for ; Tue, 2 Oct 2018 00:08:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.501 X-Spam-Level: X-Spam-Status: No, score=-109.501 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id KJ2o90qri8qY for ; Tue, 2 Oct 2018 00:08:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id EA2A15F536 for ; Tue, 2 Oct 2018 00:08:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 06619E25B2 for ; Tue, 2 Oct 2018 00:08:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 4D8D927762 for ; Tue, 2 Oct 2018 00:08:00 +0000 (UTC) Date: Tue, 2 Oct 2018 00:08:00 +0000 (UTC) From: "Jonathan Valliere (JIRA)" To: dev@mina.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (DIRMINA-1095) Seems like the management f UDP sessions is really unneficient MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DIRMINA-1095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16634787#comment-16634787 ] Jonathan Valliere edited comment on DIRMINA-1095 at 10/2/18 12:07 AM: ---------------------------------------------------------------------- [~elecharny] Adding the boolean gate somehow causes this in the 2.1.0 branch. [ERROR] Tests run: 5, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 38.055 s <<< FAILURE! - in org.apache.mina.filter.executor.PriorityThreadPoolExecutorTest [ERROR] testPrioritisation(org.apache.mina.filter.executor.PriorityThreadPoolExecutorTest) Time elapsed: 38.054 s <<< FAILURE! java.lang.AssertionError: All other sessions should have finished later than the preferred session (but at least one did not). at org.apache.mina.filter.executor.PriorityThreadPoolExecutorTest.testPrioritisation(PriorityThreadPoolExecutorTest.java:214) was (Author: johnnyv): [~elecharny] > Seems like the management f UDP sessions is really unneficient > -------------------------------------------------------------- > > Key: DIRMINA-1095 > URL: https://issues.apache.org/jira/browse/DIRMINA-1095 > Project: MINA > Issue Type: Improvement > Affects Versions: 2.0.19 > Reporter: Emmanuel Lecharny > Priority: Major > Fix For: 2.0.20 > > > When we process incoming UDP messages, we iterate over the activated {{SelectionKey}}s. That's ok, but for each one of them, we read the data and try to flush the scheduled messages. The loop where it's done seems to iterate on *all* the managed sessions, for each keys we are processing : > {code:java} > private void processReadySessions(Set handles) { > Iterator iterator = handles.iterator(); > while (iterator.hasNext()) { > SelectionKey key = iterator.next(); > DatagramChannel handle = (DatagramChannel) key.channel(); > iterator.remove(); > try { > if (key.isValid() && key.isReadable()) { > readHandle(handle); > } > if (key.isValid() && key.isWritable()) { > for (IoSession session : getManagedSessions().values()) { > scheduleFlush((NioSession) session); > ... > {code} > There is no reason to do so. First, we should not iterate on all the managed sessions (we may have thousands), but only the sessions which have something to write, and we certainly should not do that for every active key... -- This message was sent by Atlassian JIRA (v7.6.3#76005)