-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Upgrade to latest GCS SDK #124062
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to latest GCS SDK #124062
Changes from 20 commits
a832dba
ecaa5be
946f9ac
df9eaff
41497ff
87ae6f9
43123ac
df952dc
88f276c
8a8eb57
b9440cb
6d8b72a
36a0620
437456c
39f973e
31e4f9b
2989333
6222704
d1de464
44810e9
8636aaa
828334b
bd4cc24
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| pr: 124062 | ||
| summary: Upgrade to repository-gcs to use com.google.cloud:google-cloud-storage-bom:2.50.0 | ||
| area: Snapshot/Restore | ||
| type: upgrade | ||
| issues: [] |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| Checker Framework qualifiers | ||
| Copyright 2004-present by the Checker Framework developers | ||
|
|
||
| MIT License: | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in | ||
| all copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| THE SOFTWARE. |
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| Copyright (c) 2004-2014 QOS.ch | ||
| All rights reserved. | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining | ||
| a copy of this software and associated documentation files (the | ||
| "Software"), to deal in the Software without restriction, including | ||
| without limitation the rights to use, copy, modify, merge, publish, | ||
| distribute, sublicense, and/or sell copies of the Software, and to | ||
| permit persons to whom the Software is furnished to do so, subject to | ||
| the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be | ||
| included in all copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
| EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
| MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
| NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
| LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
| OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
| WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -75,9 +75,9 @@ | |
| class GoogleCloudStorageBlobStore implements BlobStore { | ||
|
|
||
| /** | ||
| * see com.google.cloud.BaseWriteChannel#DEFAULT_CHUNK_SIZE | ||
| * see {@link com.google.cloud.storage.BaseStorageWriteChannel#chunkSize} | ||
| */ | ||
| static final int SDK_DEFAULT_CHUNK_SIZE = 60 * 256 * 1024; | ||
| static final int SDK_DEFAULT_CHUNK_SIZE = Math.toIntExact(ByteSizeValue.ofMb(16).getBytes()); | ||
|
|
||
| private static final Logger logger = LogManager.getLogger(GoogleCloudStorageBlobStore.class); | ||
|
|
||
|
|
@@ -652,7 +652,17 @@ private static final class WritableBlobChannel implements WritableByteChannel { | |
| @SuppressForbidden(reason = "channel is based on a socket") | ||
| @Override | ||
| public int write(final ByteBuffer src) throws IOException { | ||
| return SocketAccess.doPrivilegedIOException(() -> channel.write(src)); | ||
| try { | ||
| return SocketAccess.doPrivilegedIOException(() -> channel.write(src)); | ||
| } catch (IOException e) { | ||
| // BaseStorageWriteChannel#write wraps StorageException in an IOException, but BaseStorageWriteChannel#close | ||
| // does not, if we unwrap StorageExceptions here, it simplifies our retry-on-gone logic | ||
| final StorageException storageException = (StorageException) ExceptionsHelper.unwrap(e, StorageException.class); | ||
| if (storageException != null) { | ||
| throw storageException; | ||
| } | ||
| throw e; | ||
| } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The alternative to this is something like catch (IOException | StorageException e) {
StorageException se = (StorageException) ExceptionHelper.unwrap(e, StorageException.class);
if (se != null) {
// do StorageException-specific things
}
}in both catch blocks |
||
| } | ||
|
|
||
| @Override | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,6 +41,7 @@ | |
| import java.io.InputStreamReader; | ||
| import java.net.HttpURLConnection; | ||
| import java.net.Proxy; | ||
| import java.net.SocketException; | ||
| import java.net.URI; | ||
| import java.net.URL; | ||
| import java.net.UnknownHostException; | ||
|
|
@@ -275,6 +276,10 @@ protected StorageRetryStrategy getRetryStrategy() { | |
| if (ExceptionsHelper.unwrap(prevThrowable, UnknownHostException.class) != null) { | ||
| return true; | ||
| } | ||
| // Also retry on `SocketException`s | ||
| if (ExceptionsHelper.unwrap(prevThrowable, SocketException.class) != null) { | ||
| return true; | ||
| } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Something has changed at the HTTP call sites and we now get
Actually that's worse. |
||
| return delegate.shouldRetry(prevThrowable, prevResponse); | ||
| } | ||
| ); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really the
LICENSE: https://github.com/open-telemetry/opentelemetry-java/blob/main/LICENSE