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 817CD200BF0 for ; Thu, 15 Dec 2016 21:40:40 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 80109160B13; Thu, 15 Dec 2016 20:40:40 +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 C8DDD160B15 for ; Thu, 15 Dec 2016 21:40:39 +0100 (CET) Received: (qmail 22525 invoked by uid 500); 15 Dec 2016 20:40:38 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 22379 invoked by uid 99); 15 Dec 2016 20:40:38 -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; Thu, 15 Dec 2016 20:40:38 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 956E4E7DFC; Thu, 15 Dec 2016 20:40:38 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: liuml07@apache.org To: common-commits@hadoop.apache.org Date: Thu, 15 Dec 2016 20:40:39 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/2] hadoop git commit: HADOOP-13831. Correct check for error code to detect Azure Storage Throttling and provide retries. Contributed by Gaurav Kanade archived-at: Thu, 15 Dec 2016 20:40:40 -0000 HADOOP-13831. Correct check for error code to detect Azure Storage Throttling and provide retries. Contributed by Gaurav Kanade (cherry picked from commit f92913c35bfda0d565606f9fb9a301ddd4105fd8) Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/86738924 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/86738924 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/86738924 Branch: refs/heads/branch-2 Commit: 867389247f741206106bf679a78a6507b24abf82 Parents: eaa50a1 Author: Mingliang Liu Authored: Thu Dec 15 12:35:08 2016 -0800 Committer: Mingliang Liu Committed: Thu Dec 15 12:38:31 2016 -0800 ---------------------------------------------------------------------- .../apache/hadoop/fs/azure/AzureNativeFileSystemStore.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/86738924/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/AzureNativeFileSystemStore.java ---------------------------------------------------------------------- diff --git a/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/AzureNativeFileSystemStore.java b/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/AzureNativeFileSystemStore.java index dc49596..dde1081 100644 --- a/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/AzureNativeFileSystemStore.java +++ b/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/AzureNativeFileSystemStore.java @@ -26,6 +26,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.UnsupportedEncodingException; +import java.net.HttpURLConnection; import java.net.URI; import java.net.URISyntaxException; import java.net.URLDecoder; @@ -2511,8 +2512,7 @@ public class AzureNativeFileSystemStore implements NativeFileSystemStore { try { dstBlob.startCopyFromBlob(srcBlob, null, getInstrumentedContext()); } catch (StorageException se) { - if (se.getErrorCode().equals( - StorageErrorCode.SERVER_BUSY.toString())) { + if (se.getHttpStatusCode() == HttpURLConnection.HTTP_UNAVAILABLE) { int copyBlobMinBackoff = sessionConfiguration.getInt( KEY_COPYBLOB_MIN_BACKOFF_INTERVAL, DEFAULT_COPYBLOB_MIN_BACKOFF_INTERVAL); @@ -2541,8 +2541,7 @@ public class AzureNativeFileSystemStore implements NativeFileSystemStore { waitForCopyToComplete(dstBlob, getInstrumentedContext()); safeDelete(srcBlob, lease); } catch (StorageException e) { - if (e.getErrorCode().equals( - StorageErrorCode.SERVER_BUSY.toString())) { + if (e.getHttpStatusCode() == HttpURLConnection.HTTP_UNAVAILABLE) { LOG.warn("Rename: CopyBlob: StorageException: ServerBusy: Retry complete, will attempt client side copy for page blob"); InputStream ipStream = null; OutputStream opStream = null; --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-commits-help@hadoop.apache.org