Return-Path: X-Original-To: apmail-ignite-dev-archive@minotaur.apache.org Delivered-To: apmail-ignite-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A8CCF196DF for ; Wed, 30 Mar 2016 08:44:39 +0000 (UTC) Received: (qmail 23850 invoked by uid 500); 30 Mar 2016 08:44:39 -0000 Delivered-To: apmail-ignite-dev-archive@ignite.apache.org Received: (qmail 23808 invoked by uid 500); 30 Mar 2016 08:44:39 -0000 Mailing-List: contact dev-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 dev@ignite.apache.org Received: (qmail 23793 invoked by uid 99); 30 Mar 2016 08:44:39 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Mar 2016 08:44:39 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 702C5C0D55 for ; Wed, 30 Mar 2016 08:44:38 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.279 X-Spam-Level: * X-Spam-Status: No, score=1.279 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gridgain-com.20150623.gappssmtp.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id Rem8vf4PtQ-7 for ; Wed, 30 Mar 2016 08:44:36 +0000 (UTC) Received: from mail-vk0-f42.google.com (mail-vk0-f42.google.com [209.85.213.42]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id D0C1A5F231 for ; Wed, 30 Mar 2016 08:44:36 +0000 (UTC) Received: by mail-vk0-f42.google.com with SMTP id e185so51774094vkb.1 for ; Wed, 30 Mar 2016 01:44:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gridgain-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to; bh=cHhh4UHLnCloQH4OwmhiM4jW7rxSsdsbI5R0iHXElPE=; b=A4yHlxvD93dRAK+ASYwWQpZAK5L51G4wkmq+ehoA+7eFAe//03UXAQiEQo16r2DyZ1 Um9p/TB5AeE7IwUBxEh7jFkv33ENznIsOfoaZE0CPlvQl2giHaDxwtLbDS//UBXvJ3wu RUZuFlZBwNiDGAc/r20PvfMxWEznvR27CUt9HpJaVS00VpYNge4ymsev77ebtQTpJP8v u/gPLdzF8de1XHnIrMs0E0E1MpBD3tB7gbJASycKP7MFAsv18ygfmtfcS+hv+OtKZmPA Gorql3usygsPxIJPAlwd71D9p595ULOv/5KHnarraPG/GyDG2+Sm9CbQ/q8SPoU7br2p n7hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to; bh=cHhh4UHLnCloQH4OwmhiM4jW7rxSsdsbI5R0iHXElPE=; b=hqxMaGoMuE3J8ymJQv3xs9kd30rROSoCjYWTfloz1fJGmYrpbHvfVeqQlQ/2O3NFB3 ECRSSaeN+Gd2hkW3UdY3nU4iULKjNLtNLpoFihnSMzYZowELpQcP5XhPKEeQfNahQa0k JEUmIujVm+vpi3tK/DdY5DXkJKf7LZo8hLFt+7rpjsuCYEHPyOjmLM1jw5QUc5hbHXJ/ Hh5dSW7G4O3rwWfDiwPE5AuTTNOwFw9dcXROh7RNOVT1HIbOSxepTUTq7Fm3bjnIOgG0 0j8HA/3sBXvt9WOnz4Cisv8SiBictfszuoIPcDqXS8PzFCXj1NOCODnypY2Vl8c0B7uB 9HEw== X-Gm-Message-State: AD7BkJJMNE89/IRC0qmT4lEewkt0INRgGsMW+NfuYg0m7vju1ARwhcqwROBMn0u93BAApy+yk+3kExRYmKFVUHZA MIME-Version: 1.0 X-Received: by 10.31.135.200 with SMTP id j191mr4056249vkd.91.1459327475820; Wed, 30 Mar 2016 01:44:35 -0700 (PDT) Received: by 10.176.69.136 with HTTP; Wed, 30 Mar 2016 01:44:35 -0700 (PDT) In-Reply-To: References: Date: Wed, 30 Mar 2016 11:44:35 +0300 Message-ID: Subject: Re: API for asynchronous execution. From: Vladimir Ozerov To: dev@ignite.apache.org Content-Type: multipart/alternative; boundary=001a1145a1f2cefb05052f402757 --001a1145a1f2cefb05052f402757 Content-Type: text/plain; charset=UTF-8 Does it mean that if cache update rate is greater than filter execution rate, then at some point we will stop reading messages from socket? If yes, then it seems we still cannot execute cache operations: 1) Filter starts cache operation for a key. Current node is backup for this key. 2) Cache message is sent to primary node 3) Primary sends message back to current node. 4) Message is never read because of backpressure. Cache operation and filter never complete. Am I missing something? On Wed, Mar 30, 2016 at 11:23 AM, Yakov Zhdanov wrote: > Vladimir, > > Communication should stop reading from connection is there are too many > unprocessed messages. Sender will be blocked on putting message to queue. > > --Yakov > > 2016-03-30 11:11 GMT+03:00 Vladimir Ozerov : > > > Guys, > > > > Can you explain how backpressure control is implemented? What if event > > arrival speed is greater than filter processing speed? > > > > On Wed, Mar 30, 2016 at 10:37 AM, Semyon Boikov > > wrote: > > > > > Andrey, > > > > > > I agree that current situation with threading in Ignite is very > > > inconvenient when user callbacks execute some non-trivial code. But > > > changing this to async dispatch is huge refactoring, even changing this > > > just for continuous queries callback is not so easy task. > > > > > > We can start with https://issues.apache.org/jira/browse/IGNITE-2004, > and > > > if > > > more users complains arise we can think about changing others parts of > > > system. > > > > > > For now we need decisions for these points: > > > - how to specify that callback should be run asynchronously (Nikolay > > > suggested marker interface IgniteAsyncCallback, or > @IgniteAsyncCallback) > > > - where these callbacks are executed, AFAIK Nikolay added special pool > > > which is configured in IgniteConfiguration (something like > > > IgniteConfiguration.asyncCallbackThreadPoolSize) > > > > > > Regards > > > > > > > > > On Tue, Mar 29, 2016 at 10:45 PM, Andrey Kornev < > > andrewkornev@hotmail.com> > > > wrote: > > > > > > > Vladimir, Igniters > > > > > > > > Here are my 2 cents. > > > > > > > > The current situation with threading when it comes to executing user > > > > callbacks -- the CQ filters (either local or remote), the CQ > listeners, > > > the > > > > event listeners, the messaging listeners, the entry processors (did I > > > miss > > > > anything?) -- is pretty sad. The callbacks may get executed on a > system > > > > pool's thread, public pool's, utility pool's, discovery worker > thread, > > > > application thread, to name a few. It causes a lot of grief and > > > suffering, > > > > hard-to-fix races, dead locks and other bugs. > > > > > > > > I guess it's always possible to come up with a more or less > reasonable > > > > explanation to such predicament (which usually boils down to "It is > so > > > > because this is how it's implemented"), but I, as a user, could not > > care > > > > less. I want consistency. I want all my callbacks (including Entry > > > > Processors!) to be executed on the public pool's threads, to be > > precise. > > > > This is not the first time I complain about this, and I really think > > it's > > > > time to fix this mess. > > > > > > > > For a good example of how to implement ordered async dispatch of > > > callbacks > > > > on large scale, one only needs to look at Akka (or Reactor > > > > https://github.com/reactor/reactor). Coherence also managed to get > it > > > > right (in my opinion, that is). > > > > > > > > Regards > > > > Andrey > > > > > > > > > > > > > > --001a1145a1f2cefb05052f402757--