From notifications-return-43673-archive-asf-public=cust-asf.ponee.io@accumulo.apache.org Wed Jun 6 23:21:31 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id E1795180671 for ; Wed, 6 Jun 2018 23:21:30 +0200 (CEST) Received: (qmail 13412 invoked by uid 500); 6 Jun 2018 21:21:30 -0000 Mailing-List: contact notifications-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jira@apache.org Delivered-To: mailing list notifications@accumulo.apache.org Received: (qmail 13401 invoked by uid 99); 6 Jun 2018 21:21:29 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jun 2018 21:21:29 +0000 From: GitBox To: notifications@accumulo.apache.org Subject: [GitHub] mikewalch closed pull request #516: Adding better handling of WAL close exceptions Message-ID: <152832008944.17757.5775212164309431870.gitbox@gitbox.apache.org> Date: Wed, 06 Jun 2018 21:21:29 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit mikewalch closed pull request #516: Adding better handling of WAL close exceptions URL: https://github.com/apache/accumulo/pull/516 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/log/DfsLogger.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/log/DfsLogger.java index 9e7a7531e8..b19b2c28d5 100644 --- a/server/tserver/src/main/java/org/apache/accumulo/tserver/log/DfsLogger.java +++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/log/DfsLogger.java @@ -618,6 +618,8 @@ public synchronized void defineTablet(long seq, int tid, KeyExtent tablet) throw key.tablet = tablet; try { write(key, EMPTY); + } catch (ClosedChannelException ex) { + throw new LogClosedException(); } catch (IllegalArgumentException e) { log.error("Signature of sync method changed. Accumulo is likely" + " incompatible with this version of Hadoop."); @@ -626,9 +628,13 @@ public synchronized void defineTablet(long seq, int tid, KeyExtent tablet) throw } private synchronized void write(LogFileKey key, LogFileValue value) throws IOException { - key.write(encryptingLogFile); - value.write(encryptingLogFile); - encryptingLogFile.flush(); + try { + key.write(encryptingLogFile); + value.write(encryptingLogFile); + encryptingLogFile.flush(); + } catch (ClosedChannelException e) { + throw new LogClosedException(); + } } public LoggerOperation log(long seq, int tid, Mutation mutation, Durability durability) diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/log/TabletServerLogger.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/log/TabletServerLogger.java index a34fc829fd..44cad40e6e 100644 --- a/server/tserver/src/main/java/org/apache/accumulo/tserver/log/TabletServerLogger.java +++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/log/TabletServerLogger.java @@ -17,6 +17,7 @@ package org.apache.accumulo.tserver.log; import java.io.IOException; +import java.nio.channels.ClosedChannelException; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -423,7 +424,7 @@ private void write(final Collection sessions, boolean mincFinish, // double-check: did the log set change? success = (currentLogId == logId.get()); } - } catch (DfsLogger.LogClosedException ex) { + } catch (DfsLogger.LogClosedException | ClosedChannelException ex) { writeRetry.logRetry(log, "Logs closed while writing", ex); } catch (Exception t) { writeRetry.logRetry(log, "Failed to write to WAL", t); ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org With regards, Apache Git Services