Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D61E9200BE9 for ; Mon, 26 Dec 2016 11:29:59 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id D4B20160B3E; Mon, 26 Dec 2016 10:29:59 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 34CB7160B2A for ; Mon, 26 Dec 2016 11:29:59 +0100 (CET) Received: (qmail 78812 invoked by uid 500); 26 Dec 2016 10:29:58 -0000 Mailing-List: contact issues-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list issues@ignite.apache.org Received: (qmail 78798 invoked by uid 99); 26 Dec 2016 10:29:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Dec 2016 10:29:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 553F02C022B for ; Mon, 26 Dec 2016 10:29:58 +0000 (UTC) Date: Mon, 26 Dec 2016 10:29:58 +0000 (UTC) From: "Vladimir Ozerov (JIRA)" To: issues@ignite.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (IGNITE-4476) GridIoManger must always process messages asynchronously MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 26 Dec 2016 10:30:00 -0000 [ https://issues.apache.org/jira/browse/IGNITE-4476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15778085#comment-15778085 ] Vladimir Ozerov commented on IGNITE-4476: ----------------------------------------- Personally I observed in GridGain plugin. Yes, it is proprietary code, but it demonstrated the problem nicely. In short, we have the following pseudocode there: {code} rwLock.readLock(); GridIoManger.send(...); rwLock.readUnlock(); {code} We expect that this code piece will be executed quickly, and read lock will be released. However, this piece of code is executed synchronously, what leads to very dready deadlock on {{readLock <- writeLock <- readLock}} chain. That is, we have hidden deadlocks in a product due to this optimization. I am not talking about striped pool, it is out of a question here. My point is that if message should be executed in pool X by design, it should be executed in this pool irrespectively of whether this is local or remote message. > GridIoManger must always process messages asynchronously > -------------------------------------------------------- > > Key: IGNITE-4476 > URL: https://issues.apache.org/jira/browse/IGNITE-4476 > Project: Ignite > Issue Type: Task > Components: general > Affects Versions: 1.8 > Reporter: Vladimir Ozerov > Fix For: 2.0 > > > *Problem* > If message is to be sent to remote node, we just send it (surprise :-)). But if message is to be sent to local node, we have a strange "optimization" - we process it synchronously in the same thread. > This is wrong as it easily leads to all kind of weird starvations and deadlocks. > *Solution* > Never ever process messages synchronously. For local node we should put message runnable into appropriate thread pool and exit. -- This message was sent by Atlassian JIRA (v6.3.4#6332)