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 A061B200C4B for ; Mon, 20 Mar 2017 08:29:10 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 9EE3C160B81; Mon, 20 Mar 2017 07:29:10 +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 E73D5160B76 for ; Mon, 20 Mar 2017 08:29:09 +0100 (CET) Received: (qmail 26739 invoked by uid 500); 20 Mar 2017 07:29:09 -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 26726 invoked by uid 99); 20 Mar 2017 07:29:08 -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; Mon, 20 Mar 2017 07:29:08 +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 4A05B1823C9 for ; Mon, 20 Mar 2017 07:29:08 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.898 X-Spam-Level: * X-Spam-Status: No, score=1.898 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id OZbVlbDW3PCR for ; Mon, 20 Mar 2017 07:29:06 +0000 (UTC) Received: from mail-vk0-f43.google.com (mail-vk0-f43.google.com [209.85.213.43]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 97FB75FBBB for ; Mon, 20 Mar 2017 07:29:06 +0000 (UTC) Received: by mail-vk0-f43.google.com with SMTP id x75so65724481vke.2 for ; Mon, 20 Mar 2017 00:29:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=ikNEh99yJsp3nqcMtjJOyI+v+qNW8GzOUJ+Uc1oTijA=; b=FNEdLbNAIkyJXNBCORm3/8YmRMUsWRgbeIdAPDR9QaiIS8ymJ49qFhe25yIyleJqrI 74UTVOJftSxOc9JA1v9yfcZf3U1dsGYWEEe4TipWcuflMdek9GdsOX0Dn+nG6UeBFmDz hbGTHNuyyEzD8+r7SdkBZjD7UHSJbWotBKXGJcKhKfWq2+sm6nufnCMLbgvOHSq4wfxC k6OaBxZtvWbdOcbX6DoYZhwW73Uzr6TM0EveLk2K0tOvVdro/Bh1H348iNwYCF8ojDvH ExNMZnWnNWGy33TOOsrjFC3Gprpqm9ivFI8gn93KaFfZtm1JSSU5Xyl4sqKYLA8fLYpF 9g6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=ikNEh99yJsp3nqcMtjJOyI+v+qNW8GzOUJ+Uc1oTijA=; b=oWW4TGclHuvOdiAndvPN88YAHatoTM4k/Q8R0U5wdjMmwKVYTYHaHrRXawYnWUT2KG kZ3jTfIBbkZ24bLsZAiqYfClS5t+ZMZ4uM/NR3SnLF35auHmciiZ0ylLUaUJkYfK5ABZ KlcotjiRHOHu8+bASnxv9C/ni1Q2DkUo1u0gyv1G80YUgKgvATF4asg2ji+6U2CD/PWm B2nelrwmDKHuKFvKfT2tQ9EEfsSLZ03Uoxsb1JckN8FPEGUTzYWmg2z/6P16K6UJJ0Gm GKjh8geXfs6Z8ctO2edQC8YhlQA0rdhmXs5aPBnE1R89hRHFBcf4geUZswVlJ4+GAx3z 57Cg== X-Gm-Message-State: AFeK/H1IYv4CwYWWObiuui5iy8c/v84SdS1hiOiZ4dDrf3WzosOL556sXo7r4lBva5NZQynkcQwYw6KEECW3sw== X-Received: by 10.31.190.137 with SMTP id o131mr10816641vkf.46.1489994936765; Mon, 20 Mar 2017 00:28:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.176.86.68 with HTTP; Mon, 20 Mar 2017 00:28:56 -0700 (PDT) In-Reply-To: References: From: Alexey Goncharuk Date: Mon, 20 Mar 2017 10:28:56 +0300 Message-ID: Subject: Re: IgniteSemaphore and failoverSafe flag To: dev@ignite.apache.org Content-Type: multipart/alternative; boundary=001a11c11258ec550c054b247ad4 archived-at: Mon, 20 Mar 2017 07:29:10 -0000 --001a11c11258ec550c054b247ad4 Content-Type: text/plain; charset=UTF-8 I think re-creation should be handled by a user who will make sure that nobody else is currently executing the guarded logic before the re-creation. This is exactly the same semantics as with BrokenBarrierException for j.u.c.CyclicBarrier. 2017-03-17 2:39 GMT+03:00 Vladisav Jelisavcic : > Hi everyone, > > I agree with Val, he's got a point; recreating the lock doesn't seem > possible > (at least not the with the transactional cache lock/semaphore we have). > Is this re-create behavior really needed? > > Best regards, > Vladisav > > > > On Thu, Mar 16, 2017 at 8:34 PM, Valentin Kulichenko < > valentin.kulichenko@gmail.com> wrote: > > > Guys, > > > > How does recreation of the lock helps? My understanding is that scenario > is > > the following: > > > > 1. Client A creates and acquires a lock, and then starts to execute > guarded > > logic. > > 2. Client B tries to acquire the same lock and parks to wait. > > 3. Before client A unlocks, all affinity nodes for the lock fail, lock > > disappears from the cache. > > 4. Client B fails with exception, recreates the lock, acquires it, and > > starts to execute guarded logic concurrently with client A. > > > > In my view this is wrong anyway, regardless of whether this happens > > silently or with an exception handled in user's code. Because this code > > doesn't have any way to know if client A still holds the lock or not. > > > > Am I missing something? > > > > -Val > > > > On Tue, Mar 14, 2017 at 10:14 AM, Dmitriy Setrakyan < > dsetrakyan@apache.org > > > > > wrote: > > > > > On Tue, Mar 14, 2017 at 12:46 AM, Alexey Goncharuk < > > > alexey.goncharuk@gmail.com> wrote: > > > > > > > > > > > > > Which user operation would result in exception? To my knowledge, > user > > > may > > > > > already be holding the lock and not invoking any Ignite APIs, no? > > > > > > > > > > > > > Yes, this is exactly my point. > > > > > > > > Imagine that a node already holds a lock and another node is waiting > > for > > > > the lock. If all partition nodes leave the grid and the lock is > > > re-created, > > > > this second node will immediately acquire the lock and we will have > two > > > > lock owners. I think in this case this second node (blocked on > lock()) > > > > should get an exception saying that the lock was lost (which is, by > the > > > > way, the current behavior), and the first node should get an > exception > > on > > > > unlock. > > > > > > > > > > Makes sense. > > > > > > --001a11c11258ec550c054b247ad4--