HADOOP-13831. Correct check for error code to detect Azure Storage Throttling and provide retries. Contributed by Gaurav Kanade
(cherry picked from commit f92913c35b
)
This commit is contained in:
parent
eaa50a1087
commit
867389247f
|
@ -26,6 +26,7 @@ import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.HttpURLConnection;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
import java.net.URLDecoder;
|
import java.net.URLDecoder;
|
||||||
|
@ -2511,8 +2512,7 @@ public class AzureNativeFileSystemStore implements NativeFileSystemStore {
|
||||||
try {
|
try {
|
||||||
dstBlob.startCopyFromBlob(srcBlob, null, getInstrumentedContext());
|
dstBlob.startCopyFromBlob(srcBlob, null, getInstrumentedContext());
|
||||||
} catch (StorageException se) {
|
} catch (StorageException se) {
|
||||||
if (se.getErrorCode().equals(
|
if (se.getHttpStatusCode() == HttpURLConnection.HTTP_UNAVAILABLE) {
|
||||||
StorageErrorCode.SERVER_BUSY.toString())) {
|
|
||||||
int copyBlobMinBackoff = sessionConfiguration.getInt(
|
int copyBlobMinBackoff = sessionConfiguration.getInt(
|
||||||
KEY_COPYBLOB_MIN_BACKOFF_INTERVAL,
|
KEY_COPYBLOB_MIN_BACKOFF_INTERVAL,
|
||||||
DEFAULT_COPYBLOB_MIN_BACKOFF_INTERVAL);
|
DEFAULT_COPYBLOB_MIN_BACKOFF_INTERVAL);
|
||||||
|
@ -2541,8 +2541,7 @@ public class AzureNativeFileSystemStore implements NativeFileSystemStore {
|
||||||
waitForCopyToComplete(dstBlob, getInstrumentedContext());
|
waitForCopyToComplete(dstBlob, getInstrumentedContext());
|
||||||
safeDelete(srcBlob, lease);
|
safeDelete(srcBlob, lease);
|
||||||
} catch (StorageException e) {
|
} catch (StorageException e) {
|
||||||
if (e.getErrorCode().equals(
|
if (e.getHttpStatusCode() == HttpURLConnection.HTTP_UNAVAILABLE) {
|
||||||
StorageErrorCode.SERVER_BUSY.toString())) {
|
|
||||||
LOG.warn("Rename: CopyBlob: StorageException: ServerBusy: Retry complete, will attempt client side copy for page blob");
|
LOG.warn("Rename: CopyBlob: StorageException: ServerBusy: Retry complete, will attempt client side copy for page blob");
|
||||||
InputStream ipStream = null;
|
InputStream ipStream = null;
|
||||||
OutputStream opStream = null;
|
OutputStream opStream = null;
|
||||||
|
|
Loading…
Reference in New Issue