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 ED8B5200C72 for ; Fri, 28 Apr 2017 03:54:02 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id EC014160BB2; Fri, 28 Apr 2017 01:54:02 +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 3E9F6160BA7 for ; Fri, 28 Apr 2017 03:54:02 +0200 (CEST) Received: (qmail 95861 invoked by uid 500); 28 Apr 2017 01:54:00 -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 95850 invoked by uid 99); 28 Apr 2017 01:54:00 -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; Fri, 28 Apr 2017 01:54:00 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 6EEA3E0005; Fri, 28 Apr 2017 01:54:00 +0000 (UTC) From: joshelser To: dev@accumulo.apache.org Reply-To: dev@accumulo.apache.org References: In-Reply-To: Subject: [GitHub] accumulo pull request #254: [ACCUMULO-4506] Add a timeout to the replication... Content-Type: text/plain Message-Id: <20170428015400.6EEA3E0005@git1-us-west.apache.org> Date: Fri, 28 Apr 2017 01:54:00 +0000 (UTC) archived-at: Fri, 28 Apr 2017 01:54:03 -0000 Github user joshelser commented on a diff in the pull request: https://github.com/apache/accumulo/pull/254#discussion_r113838793 --- Diff: server/tserver/src/main/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystem.java --- @@ -288,15 +295,36 @@ public String execute(ReplicationCoordinator.Client client) throws Exception { } } else { span = Trace.start("WAL replication"); + + ExecutorService executor = Executors.newFixedThreadPool(1); + try { - finalStatus = replicateLogs(peerContext, peerTserver, target, p, status, sizeLimit, remoteTableId, peerContext.rpcCreds(), helper, accumuloUgi); + Future replStatus = executor.submit(new Callable() { + @Override + public Status call() throws Exception { + return replicateLogs(peerContext, peerTserver, target, p, status, sizeLimit, remoteTableId, peerContext.rpcCreds(), helper, accumuloUgi); + } + }); + + log.debug("Getting replication status with timeout {}", conf.get(Property.REPLICATION_TIMEOUT)); + finalStatus = replStatus.get(conf.getTimeInMillis(Property.REPLICATION_TIMEOUT), MILLISECONDS); + log.debug("New status for {} after replicating to {} is {}", p, peerContext.getInstance(), ProtobufUtil.toString(finalStatus)); + } catch (InterruptedException e) { + log.debug("Interrupted exception during replication", e); + Thread.currentThread().interrupt(); + finalStatus = status; + } catch (ExecutionException e) { + log.warn("Caught execution exception", e); + finalStatus = status; + } catch (TimeoutException e) { + log.debug("Replication timeout triggered, shutting down"); + finalStatus = status; } finally { span.stop(); + executor.shutdownNow(); } } - log.debug("New status for {} after replicating to {} is {}", p, peerContext.getInstance(), ProtobufUtil.toString(finalStatus)); --- End diff -- What's the reasoning behind dropping this debug msg? --- 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. ---