Return-Path: X-Original-To: apmail-aurora-dev-archive@minotaur.apache.org Delivered-To: apmail-aurora-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 0C9BE10BC8 for ; Sat, 14 Dec 2013 01:32:39 +0000 (UTC) Received: (qmail 3954 invoked by uid 500); 14 Dec 2013 01:32:39 -0000 Delivered-To: apmail-aurora-dev-archive@aurora.apache.org Received: (qmail 3913 invoked by uid 500); 14 Dec 2013 01:32:39 -0000 Mailing-List: contact dev-help@aurora.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@aurora.incubator.apache.org Delivered-To: mailing list dev@aurora.incubator.apache.org Received: (qmail 3905 invoked by uid 99); 14 Dec 2013 01:32:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Dec 2013 01:32:38 +0000 X-ASF-Spam-Status: No, hits=-1997.9 required=5.0 tests=ALL_TRUSTED,HTML_MESSAGE,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Sat, 14 Dec 2013 01:32:34 +0000 Received: (qmail 3575 invoked by uid 99); 14 Dec 2013 01:32:13 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Dec 2013 01:32:13 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 532511D3F0D; Sat, 14 Dec 2013 01:32:12 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============1361783962675890725==" MIME-Version: 1.0 Subject: Re: Review Request 16268: Lock should be released if job does not exist From: "Maxim Khutornenko" To: "Bill Farner" , "Brian Wickman" Cc: "Maxim Khutornenko" , "Aurora" Date: Sat, 14 Dec 2013 01:32:12 -0000 Message-ID: <20131214013212.27438.81320@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org Auto-Submitted: auto-generated Sender: "Maxim Khutornenko" X-ReviewGroup: Aurora X-ReviewRequest-URL: https://reviews.apache.org/r/16268/ X-Sender: "Maxim Khutornenko" References: <20131214012650.27438.56855@reviews.apache.org> In-Reply-To: <20131214012650.27438.56855@reviews.apache.org> Reply-To: "Maxim Khutornenko" X-ReviewRequest-Repository: aurora X-Virus-Checked: Checked by ClamAV on apache.org --===============1361783962675890725== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit > On Dec. 14, 2013, 1:26 a.m., Bill Farner wrote: > > src/main/python/twitter/aurora/client/api/updater.py, line 376 > > > > > > I think this is unsafe. 'Error' is definitely too generic to determine that it's safe to release the lock. Even recognizing that a locking-related error was encountered may not be enough, since in the future other locks could be held. The whole point of applying locks is to prevent simultaneous updates. In _get_update_instructions we are just gathering information and not applying any changes. The update has technically not started yet and no mutations were attempted. What's the point of holding the lock at this stage? - Maxim ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/16268/#review30393 ----------------------------------------------------------- On Dec. 14, 2013, 1:21 a.m., Maxim Khutornenko wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/16268/ > ----------------------------------------------------------- > > (Updated Dec. 14, 2013, 1:21 a.m.) > > > Review request for Aurora, Bill Farner and Brian Wickman. > > > Repository: aurora > > > Description > ------- > > Releasing the lock if the update is unable to start for any reason. > > > Diffs > ----- > > src/main/python/twitter/aurora/client/api/updater.py 32bd6a1bf6bf401b0341b6e14e570d83c3e79dd5 > src/test/python/twitter/aurora/client/api/test_updater.py 0b60d9e04428eb55168e3a9c3a394f19aed2f9d2 > > Diff: https://reviews.apache.org/r/16268/diff/ > > > Testing > ------- > > $ ./pants src/test/python/twitter/aurora/client/api:updater > Build operating on targets: OrderedSet([PythonTests(src/test/python/twitter/aurora/client/api/BUILD:updater)]) > ============================================================================== test session starts =============================================================================== > platform darwin -- Python 2.7.3 -- pytest-2.5.0 > collected 24 items > > src/test/python/twitter/aurora/client/api/test_updater.py ........................ > > =========================================================================== 24 passed in 0.26 seconds ============================================================================ > src.test.python.twitter.aurora.client.api.updater ..... SUCCESS > > > Thanks, > > Maxim Khutornenko > > --===============1361783962675890725==--