Я пытаюсь загрузить 250 файлов размером около 5 МБ с помощью моего Azure клиента хранения в версии 12.4.0 в моем приложении Spring Boot . Сразу после выполнения этой загрузки с помощью JMeter я получаю сообщение об ошибке, затем через несколько минут большинство файлов загружаются, а некоторые завершаются с ошибкой. Я добавил все журналы и код ниже.
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-storage-blob</artifactId>
<version>12.4.0</version>
</dependency>
Код клиента
public class AzureStorageClient implements StorageClient {
private final Logger LOGGER = LoggerFactory.getLogger(AzureStorageClient.class);
private final BlobContainerClient containerClient;
public AzureStorageClient(final AzureStorageServiceProvider provider, String storageContainer) {
var serviceClient = provider.createServiceClient();
this.containerClient = serviceClient.getBlobContainerClient(storageContainer);
if (!this.containerClient.exists()) {
throw new StorageClientInitException("No container exists with name " + storageContainer);
}
}
@Override
public void store(final String blobPath, final String originalFileName, final byte[] bytes) {
final BlobClient blobClient = containerClient.getBlobClient(blobPath);
final BlockBlobClient blockBlobClient = blobClient.getBlockBlobClient();
try (ByteArrayInputStream inputStream = new ByteArrayInputStream(bytes)) {
LOGGER.info("Started: upload file {} with original name {}", blobPath, originalFileName);
blockBlobClient.upload(inputStream, bytes.length, true);
LOGGER.info("Finished: file {} with original name {}", blobPath, originalFileName);
} catch (BlobStorageException | IOException exc) {
throw new StorageException(exc);
}
}
}
Ошибки сразу после загрузки:
2020-04-06 21:55:00.374 WARN 1700 --- [ctor-http-nio-3] r.netty.http.client.HttpClientConnect : [id: 0x441e3068, L:/192.168.0.11:55049 - R:somestorageaccount.blob.core.windows.net/11.11.111.11:443] The connection observed an error
javax.net.ssl.SSLException: handshake timed out
at io.netty.handler.ssl.SslHandler$5.run(SslHandler.java:2001) ~[netty-handler-4.1.45.Final.jar:4.1.45.Final]
at io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98) ~[netty-common-4.1.45.Final.jar:4.1.45.Final]
at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:170) ~[netty-common-4.1.45.Final.jar:4.1.45.Final]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164) ~[netty-common-4.1.45.Final.jar:4.1.45.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472) ~[netty-common-4.1.45.Final.jar:4.1.45.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500) ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) ~[netty-common-4.1.45.Final.jar:4.1.45.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.45.Final.jar:4.1.45.Final]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.45.Final.jar:4.1.45.Final]
at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]
2020-04-06 21:55:01.717 WARN 1700 --- [ctor-http-nio-3] r.netty.http.client.HttpClientConnect : [id: 0x16c7448d, L:/192.168.0.11:55085 - R:somestorageaccount.blob.core.windows.net/11.11.111.11:443] The connection observed an error
javax.net.ssl.SSLException: handshake timed out
at io.netty.handler.ssl.SslHandler$5.run(SslHandler.java:2001) ~[netty-handler-4.1.45.Final.jar:4.1.45.Final]
at io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98) ~[netty-common-4.1.45.Final.jar:4.1.45.Final]
at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:170) ~[netty-common-4.1.45.Final.jar:4.1.45.Final]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164) ~[netty-common-4.1.45.Final.jar:4.1.45.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472) ~[netty-common-4.1.45.Final.jar:4.1.45.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500) ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) ~[netty-common-4.1.45.Final.jar:4.1.45.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.45.Final.jar:4.1.45.Final]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.45.Final.jar:4.1.45.Final]
at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]
2020-04-06 21:55:03.028 WARN 1700 --- [ctor-http-nio-6] r.netty.http.client.HttpClientConnect : [id: 0x13bee15d, L:/192.168.0.11:55064 - R:somestorageaccount.blob.core.windows.net/11.11.111.11:443] The connection observed an error
javax.net.ssl.SSLException: handshake timed out
at io.netty.handler.ssl.SslHandler$5.run(SslHandler.java:2001) ~[netty-handler-4.1.45.Final.jar:4.1.45.Final]
at io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98) ~[netty-common-4.1.45.Final.jar:4.1.45.Final]
at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:170) ~[netty-common-4.1.45.Final.jar:4.1.45.Final]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164) ~[netty-common-4.1.45.Final.jar:4.1.45.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472) ~[netty-common-4.1.45.Final.jar:4.1.45.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500) ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) ~[netty-common-4.1.45.Final.jar:4.1.45.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.45.Final.jar:4.1.45.Final]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.45.Final.jar:4.1.45.Final]
at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]
2020-04-06 21:55:03.957 WARN 1700 --- [tor-http-nio-12] r.netty.http.client.HttpClientConnect : [id: 0x196d50c9, L:/192.168.0.11:55118 - R:somestorageaccount.blob.core.windows.net/11.11.111.11:443] The connection observed an error
javax.net.ssl.SSLException: handshake timed out
at io.netty.handler.ssl.SslHandler$5.run(SslHandler.java:2001) ~[netty-handler-4.1.45.Final.jar:4.1.45.Final]
at io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98) ~[netty-common-4.1.45.Final.jar:4.1.45.Final]
at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:170) ~[netty-common-4.1.45.Final.jar:4.1.45.Final]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164) ~[netty-common-4.1.45.Final.jar:4.1.45.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472) ~[netty-common-4.1.45.Final.jar:4.1.45.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500) ~[netty-transport-4.1.45.Final.jar:4.1.45.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) ~[netty-common-4.1.45.Final.jar:4.1.45.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.45.Final.jar:4.1.45.Final]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.45.Final.jar:4.1.45.Final]
at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]
2020-04-06 21:55:13.369 WARN 1700 --- [ctor-http-nio-8] r.netty.http.client.HttpClientConnect : [id: 0x5a704036, L:0.0.0.0/0.0.0.0:55054] The connection observed an error
reactor.netty.http.client.PrematureCloseException: Connection has been closed BEFORE response, while sending request body
Через некоторое время загружаются файлы, но не все:
020-04-06 21:58:38.989 INFO 1700 --- [io-8080-exec-34] c.c.f.cloud.AzureStorageClient : Finished: file 40fcbd8fc41b447f91fc9e01c11a79fb with original name oswietlenie.pdf
2020-04-06 21:58:51.835 WARN 1700 --- [ctor-http-nio-8] r.netty.http.client.HttpClientConnect : [id: 0xfc719110, L:0.0.0.0/0.0.0.0:55102] The connection observed an error
reactor.netty.http.client.PrematureCloseException: Connection has been closed BEFORE response, while sending request body
2020-04-06 21:58:56.033 WARN 1700 --- [tor-http-nio-12] r.netty.http.client.HttpClientConnect : [id: 0x870e83db, L:0.0.0.0/0.0.0.0:55082] The connection observed an error
reactor.netty.http.client.PrematureCloseException: Connection has been closed BEFORE response, while sending request body
2020-04-06 21:59:00.580 INFO 1700 --- [io-8080-exec-62] c.c.f.cloud.AzureStorageClient : Finished: file b007415bfd114a15b9fcbd3591f0b35a with original name oswietlenie.pdf