Skip to content

Commit 351d234

Browse files
authored
Upgrade Azure SDK to version 12.14.4 (#83884)
1 parent b841b5f commit 351d234

35 files changed

+76
-104
lines changed

modules/repository-azure/azure-storage-blob/build.gradle

-47
This file was deleted.

modules/repository-azure/build.gradle

+37-31
Original file line numberDiff line numberDiff line change
@@ -23,50 +23,47 @@ esplugin {
2323
}
2424

2525
versions << [
26-
'azure': '12.9.0',
27-
'azureCore': '1.10.0',
28-
'azureCoreHttpNetty': '1.6.3',
26+
'azure': '12.14.4',
27+
'azureCommon': '12.14.3',
28+
'azureCore': '1.25.0',
29+
'azureCoreHttpNetty': '1.11.7',
30+
'azureJackson': '2.13.2',
31+
'azureJacksonDatabind': '2.13.2.2',
2932

3033
'jakartaActivation': '1.2.1',
3134
'jakartaXMLBind': '2.3.2',
32-
'stax2API': '4.2',
33-
'woodstox': '6.0.2',
35+
'stax2API': '4.2.1',
36+
'woodstox': '6.2.7',
3437

35-
'reactorNetty': '0.9.12.RELEASE',
36-
'reactorCore': '3.3.10.RELEASE',
38+
'reactorNetty': '1.0.14',
39+
'reactorCore': '3.4.13',
3740
'reactiveStreams': '1.0.3',
3841
]
3942

4043
dependencies {
41-
api project(path: 'azure-storage-blob', configuration: 'shadow')
42-
if (isEclipse) {
43-
/*
44-
* Eclipse can't pick up the shadow dependency so we point it at *something*
45-
* so it can compile things.
46-
*/
47-
api project(path: 'azure-storage-blob')
48-
}
49-
api "com.azure:azure-storage-common:${versions.azure}"
44+
api "com.azure:azure-storage-blob:${versions.azure}"
45+
api "com.azure:azure-storage-common:${versions.azureCommon}"
5046
api "com.azure:azure-core-http-netty:${versions.azureCoreHttpNetty}"
5147
api "com.azure:azure-core:${versions.azureCore}"
5248

5349
// jackson
54-
api "com.fasterxml.jackson.core:jackson-core:${versions.jackson}"
55-
api "com.fasterxml.jackson.core:jackson-databind:${versions.jackson}"
56-
api "com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}"
57-
api "com.fasterxml.jackson.core:jackson-databind:${versions.jackson}"
50+
api "com.fasterxml.jackson.core:jackson-core:${versions.azureJackson}"
51+
api "com.fasterxml.jackson.core:jackson-databind:${versions.azureJacksonDatabind}"
52+
api "com.fasterxml.jackson.core:jackson-annotations:${versions.azureJackson}"
5853

5954
// jackson xml
60-
api "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${versions.jackson}"
61-
api "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${versions.jackson}"
62-
api "com.fasterxml.jackson.module:jackson-module-jaxb-annotations:${versions.jackson}"
55+
api "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${versions.azureJackson}"
56+
api "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${versions.azureJackson}"
57+
api "com.fasterxml.jackson.module:jackson-module-jaxb-annotations:${versions.azureJackson}"
6358
api "jakarta.activation:jakarta.activation-api:${versions.jakartaActivation}"
59+
// The SDK uses javax.xml bindings
6460
api "jakarta.xml.bind:jakarta.xml.bind-api:${versions.jakartaXMLBind}"
6561
api "org.codehaus.woodstox:stax2-api:${versions.stax2API}"
6662
api "com.fasterxml.woodstox:woodstox-core:${versions.woodstox}"
6763

6864
// netty
6965
api "io.netty:netty-buffer:${versions.netty}"
66+
api "io.netty:netty-codec-dns:${versions.netty}"
7067
api "io.netty:netty-codec-http:${versions.netty}"
7168
api "io.netty:netty-codec-http2:${versions.netty}"
7269
api "io.netty:netty-codec-socks:${versions.netty}"
@@ -75,10 +72,13 @@ dependencies {
7572
api "io.netty:netty-handler-proxy:${versions.netty}"
7673
api "io.netty:netty-handler:${versions.netty}"
7774
api "io.netty:netty-resolver:${versions.netty}"
75+
api "io.netty:netty-resolver-dns:${versions.netty}"
7876
api "io.netty:netty-transport:${versions.netty}"
77+
api "io.netty:netty-transport-native-unix-common:${versions.netty}"
7978

8079
// reactor
81-
api "io.projectreactor.netty:reactor-netty:${versions.reactorNetty}"
80+
api "io.projectreactor.netty:reactor-netty-core:${versions.reactorNetty}"
81+
api "io.projectreactor.netty:reactor-netty-http:${versions.reactorNetty}"
8282
api "io.projectreactor:reactor-core:${versions.reactorCore}"
8383
api "org.reactivestreams:reactive-streams:${versions.reactiveStreams}"
8484

@@ -110,6 +110,7 @@ tasks.named("dependencyLicenses").configure {
110110
mapping from: /netty-.*/, to: 'netty'
111111
mapping from: /jaxb-.*/, to: 'jaxb'
112112
mapping from: /stax-.*/, to: 'stax'
113+
mapping from: /reactor-netty-.*/, to: 'reactor-netty'
113114
mapping from: /reactive-streams.*/, to: 'reactive-streams'
114115
}
115116

@@ -122,6 +123,11 @@ tasks.named("thirdPartyAudit").configure {
122123
'com.aayushatharva.brotli4j.encoder.Encoder$Mode',
123124
'com.aayushatharva.brotli4j.encoder.Encoder$Parameters',
124125

126+
'com.azure.storage.internal.avro.implementation.AvroObject',
127+
'com.azure.storage.internal.avro.implementation.AvroReader',
128+
'com.azure.storage.internal.avro.implementation.AvroReaderFactory',
129+
'com.azure.storage.internal.avro.implementation.schema.AvroSchema',
130+
125131
// from reactory-netty metric collection
126132
'io.micrometer.core.instrument.Clock',
127133
'io.micrometer.core.instrument.Counter',
@@ -255,11 +261,17 @@ tasks.named("thirdPartyAudit").configure {
255261
'io.netty.channel.kqueue.KQueueDatagramChannel',
256262
'io.netty.channel.kqueue.KQueueServerSocketChannel',
257263
'io.netty.channel.kqueue.KQueueSocketChannel',
264+
258265
'io.netty.channel.epoll.Epoll',
259266
'io.netty.channel.epoll.EpollDatagramChannel',
260267
'io.netty.channel.epoll.EpollServerSocketChannel',
261268
'io.netty.channel.epoll.EpollSocketChannel',
262269

270+
'io.netty.incubator.channel.uring.IOUring',
271+
'io.netty.incubator.channel.uring.IOUringDatagramChannel',
272+
'io.netty.incubator.channel.uring.IOUringServerSocketChannel',
273+
'io.netty.incubator.channel.uring.IOUringSocketChannel',
274+
263275
// from reactor.netty.http.server.HttpServer (reactor-netty)
264276
'io.netty.handler.codec.haproxy.HAProxyMessage',
265277
'io.netty.handler.codec.haproxy.HAProxyMessageDecoder',
@@ -269,8 +281,7 @@ tasks.named("thirdPartyAudit").configure {
269281
'org.osgi.framework.BundleContext',
270282

271283
// from com.ctc.wstx.shaded.msv_core.driver.textui.Driver (woodstox-core)
272-
'com.sun.org.apache.xml.internal.resolver.Catalog',
273-
'com.sun.org.apache.xml.internal.resolver.tools.CatalogResolver',
284+
'com.ctc.wstx.shaded.msv_core.driver.textui.Driver',
274285
// [missing classes] SLF4j includes an optional class that depends on an extension class. see Log4jLogger#createConverter
275286
'org.slf4j.ext.EventData'
276287
)
@@ -297,12 +308,7 @@ tasks.named("thirdPartyAudit").configure {
297308

298309
'javax.activation.MailcapCommandMap',
299310
'javax.activation.MimetypesFileTypeMap',
300-
301-
'reactor.core.publisher.MultiProducerRingBuffer',
302-
'reactor.core.publisher.RingBufferFields',
303311
'reactor.core.publisher.Traces$SharedSecretsCallSiteSupplierFactory$TracingException',
304-
'reactor.core.publisher.UnsafeSequence',
305-
'reactor.core.publisher.UnsafeSupport'
306312
)
307313
}
308314
boolean useFixture = false

modules/repository-azure/licenses/azure-core-1.10.0.jar.sha1

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
85db86803538e6d01051ae9ee21f56684ea9995b
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
c6b14fcca3e75acc8dbe07ac101afd05d48a1647

modules/repository-azure/licenses/azure-core-http-netty-1.6.3.jar.sha1

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2b92020693d09e4980b96d278e8038a1087afea0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
e8d6258aa8bf1594980c01294e60de74d13a815f

modules/repository-azure/licenses/azure-storage-common-12.9.0.jar.sha1

-1
This file was deleted.

modules/repository-azure/licenses/jackson-annotations-2.10.4.jar.sha1

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ec18851f1976d5b810ae1a5fcc32520d2d38f77a

modules/repository-azure/licenses/jackson-core-2.10.4.jar.sha1

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0a6a0e0620d51833feffc67bccb51937b2345763

modules/repository-azure/licenses/jackson-databind-2.10.4.jar.sha1

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ffeb635597d093509f33e1e94274d14be610f933

modules/repository-azure/licenses/jackson-dataformat-xml-2.10.4.jar.sha1

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cb6a722f128ff0ce2494384d419b6ff20fad25ab

modules/repository-azure/licenses/jackson-datatype-jsr310-2.10.4.jar.sha1

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cddd9380efd4b81ea01e98be8fbdc9765a81793b

modules/repository-azure/licenses/jackson-module-jaxb-annotations-2.10.4.jar.sha1

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
e2f198c512f0f0ccbd6d618baecc9dde9975eadf
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2f8d808c01eb3a49435c8c8e9b3b47d0d616a75c
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
8ec11e228f827dbccf79573a18c4831785aab8be
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
6b173e3fde38290859446db7889422e6ff0980d9

modules/repository-azure/licenses/reactor-core-3.3.10.RELEASE.jar.sha1

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7066cb27d2eee153b07b10647598cec75e817d2d

modules/repository-azure/licenses/reactor-netty-0.9.12.RELEASE.jar.sha1

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
02e945beb0e38e2f8ea2da0ffa09e845ba74d5df
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bca6b7b9a183e3fb7c223ff3a18c1ea94ca318d6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
a3f7325c52240418c2ba257b103c3c550e140c83

modules/repository-azure/licenses/stax2-api-4.2.jar.sha1

-1
This file was deleted.

modules/repository-azure/licenses/woodstox-core-6.0.2.jar.sha1

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
86622cfd0a9933628b6b876d0c92589148d3b42e

modules/repository-azure/src/internalClusterTest/java/org/elasticsearch/repositories/azure/AzureBlobStoreRepositoryTests.java

+9-6
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,15 @@ protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
9393
final MockSecureSettings secureSettings = new MockSecureSettings();
9494
String accountName = DEFAULT_ACCOUNT_NAME;
9595
secureSettings.setString(AzureStorageSettings.ACCOUNT_SETTING.getConcreteSettingForNamespace("test").getKey(), accountName);
96-
secureSettings.setString(
97-
(randomBoolean() ? AzureStorageSettings.KEY_SETTING : AzureStorageSettings.SAS_TOKEN_SETTING).getConcreteSettingForNamespace(
98-
"test"
99-
).getKey(),
100-
key
101-
);
96+
if (randomBoolean()) {
97+
secureSettings.setString(AzureStorageSettings.KEY_SETTING.getConcreteSettingForNamespace("test").getKey(), key);
98+
} else {
99+
// The SDK expects a valid SAS TOKEN
100+
secureSettings.setString(
101+
AzureStorageSettings.SAS_TOKEN_SETTING.getConcreteSettingForNamespace("test").getKey(),
102+
"se=2021-07-20T13%3A21Z&sp=rwdl&sv=2018-11-09&sr=c&sig=random"
103+
);
104+
}
102105

103106
// see com.azure.storage.blob.BlobUrlParts.parseIpUrl
104107
final String endpoint = "ignored;DefaultEndpointsProtocol=http;BlobEndpoint=" + httpServerUrl() + "/" + accountName;

modules/repository-azure/src/main/java/org/elasticsearch/repositories/azure/AzureClientProvider.java

+12-7
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@
1313
import io.netty.channel.ChannelOption;
1414
import io.netty.channel.EventLoopGroup;
1515
import io.netty.channel.nio.NioEventLoopGroup;
16+
import io.netty.resolver.DefaultAddressResolverGroup;
1617
import reactor.core.publisher.Mono;
1718
import reactor.core.scheduler.Scheduler;
1819
import reactor.core.scheduler.Schedulers;
1920
import reactor.netty.resources.ConnectionProvider;
21+
import reactor.netty.resources.LoopResources;
2022

2123
import com.azure.core.http.HttpClient;
2224
import com.azure.core.http.HttpMethod;
@@ -94,6 +96,7 @@ class AzureClientProvider extends AbstractLifecycleComponent {
9496
private final ConnectionProvider connectionProvider;
9597
private final ByteBufAllocator byteBufAllocator;
9698
private final ClientLogger clientLogger = new ClientLogger(AzureClientProvider.class);
99+
private final LoopResources nioLoopResources;
97100
private volatile boolean closed = false;
98101

99102
AzureClientProvider(
@@ -108,6 +111,10 @@ class AzureClientProvider extends AbstractLifecycleComponent {
108111
this.eventLoopGroup = eventLoopGroup;
109112
this.connectionProvider = connectionProvider;
110113
this.byteBufAllocator = byteBufAllocator;
114+
// The underlying http client uses this as part of the connection pool key,
115+
// hence we need to use the same instance across all the client instances
116+
// to avoid creating multiple connection pools.
117+
this.nioLoopResources = useNative -> eventLoopGroup;
111118
}
112119

113120
static int eventLoopThreadsFromSettings(Settings settings) {
@@ -164,13 +171,11 @@ AzureBlobServiceClient createClient(
164171
}
165172

166173
reactor.netty.http.client.HttpClient nettyHttpClient = reactor.netty.http.client.HttpClient.create(connectionProvider);
167-
nettyHttpClient = nettyHttpClient.port(80).wiretap(false);
168-
169-
nettyHttpClient = nettyHttpClient.tcpConfiguration(tcpClient -> {
170-
tcpClient = tcpClient.runOn(eventLoopGroup);
171-
tcpClient = tcpClient.option(ChannelOption.ALLOCATOR, byteBufAllocator);
172-
return tcpClient;
173-
});
174+
nettyHttpClient = nettyHttpClient.port(80)
175+
.wiretap(false)
176+
.resolver(DefaultAddressResolverGroup.INSTANCE)
177+
.runOn(nioLoopResources)
178+
.option(ChannelOption.ALLOCATOR, byteBufAllocator);
174179

175180
final HttpClient httpClient = new NettyAsyncHttpClientBuilder(nettyHttpClient).disableBufferCopy(true).proxy(proxyOptions).build();
176181

0 commit comments

Comments
 (0)