Return-Path: X-Original-To: apmail-accumulo-dev-archive@www.apache.org Delivered-To: apmail-accumulo-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9B51819C0B for ; Sun, 24 Apr 2016 15:55:14 +0000 (UTC) Received: (qmail 93937 invoked by uid 500); 24 Apr 2016 15:55:14 -0000 Delivered-To: apmail-accumulo-dev-archive@accumulo.apache.org Received: (qmail 93892 invoked by uid 500); 24 Apr 2016 15:55:14 -0000 Mailing-List: contact dev-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list dev@accumulo.apache.org Received: (qmail 93881 invoked by uid 99); 24 Apr 2016 15:55:14 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 24 Apr 2016 15:55:14 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 0CCD5DFE60; Sun, 24 Apr 2016 15:55:14 +0000 (UTC) From: wjsl To: dev@accumulo.apache.org Reply-To: dev@accumulo.apache.org References: In-Reply-To: Subject: [GitHub] accumulo pull request: ACCUMULO-4229 BatchWriter Locator cache out... Content-Type: text/plain Message-Id: <20160424155514.0CCD5DFE60@git1-us-west.apache.org> Date: Sun, 24 Apr 2016 15:55:14 +0000 (UTC) Github user wjsl commented on a diff in the pull request: https://github.com/apache/accumulo/pull/96#discussion_r60846778 --- Diff: core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchReaderIterator.java --- @@ -329,6 +331,8 @@ private void processFailures(Map> failures, ResultReceiver // since the first call to binRanges clipped the ranges to within a tablet, we should not get only // bin to the set of failed tablets + if (!locator.isValid()) + locator = new TimeoutTabletLocator(TabletLocator.getLocator(instance, new Text(table)), timeout); --- End diff -- Since TabletServerBatchReaderIterator#lookup is synchronized, the reassignment is thread-safe for other accesses that respect the instance's lock. This reassignment, in processFailures, only ever occurs though a branch from a QueryTask, which doesn't do the reassignment in a synchronized block (it does use a semaphore inside of the QueryTask, but that's separate from the TSBI instance lock). So, where I'm going with this: is it safe to do these re-assignments outside of a synchronized block? It's implied to me that these updates can happen in different threads, since the QueryTasks are executed via an ExecutorService. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---