Skip to content

Commit

Permalink
Fix timeout exceptions when using tcnative (Azure#14748)
Browse files Browse the repository at this point in the history
* Fixed RequestTimeoutException when enabled tcnative

* remove exclusions of tcnative from the pom files

Co-authored-by: Annie Liang <xinlian@microsoft.com>
  • Loading branch information
xinlian12 and Annie Liang authored Sep 3, 2020
1 parent e03a589 commit df5a8f4
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 43 deletions.
9 changes: 0 additions & 9 deletions sdk/cosmos/azure-cosmos-benchmark/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,6 @@ Licensed under the MIT License.
<version>1.5.4</version> <!-- {x-version-update;io.micrometer:micrometer-registry-graphite;external_dependency} -->
</dependency>

<!-- Issue: We have a problem with Direct TCP with using netty-tcnative when OpenSSL 1.1 is installed
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative</artifactId>
<version>2.0.31.Final</version> {x-version-update;io.netty:netty-tcnative;external_dependency}
<classifier>linux-x86_64</classifier>
</dependency>
-->

<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
Expand Down
26 changes: 0 additions & 26 deletions sdk/cosmos/azure-cosmos-encryption/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,38 +50,12 @@ Licensed under the MIT License.
<groupId>com.azure</groupId>
<artifactId>azure-security-keyvault-keys</artifactId>
<version>4.3.0-beta.1</version> <!-- {x-version-update;com.azure:azure-security-keyvault-keys;current} -->

<!-- Due to a bug in RNTBD (https://github.com/Azure/azure-sdk-for-java/issues/7829),
transitive dependency on netty-tcnative* cause problem.
Excluding transitive dependencies and forcing azure-core to be imported from azure-cosmos.
We can remove this once the bug is fixed.
-->
<exclusions>
<exclusion>
<groupId>com.azure</groupId>
<artifactId>azure-core</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-identity</artifactId>
<version>1.2.0-beta.1</version> <!-- {x-version-update;com.azure:azure-identity;current} -->

<!-- Due to a bug in RNTBD (https://github.com/Azure/azure-sdk-for-java/issues/7829),
transitive dependency on netty-tcnative* cause problem.
Excluding transitive dependencies and forcing azure-core to be imported from azure-cosmos.
We can remove this once the bug is fixed.
-->
<exclusions>
<exclusion>
<groupId>com.azure</groupId>
<artifactId>azure-core</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- Added this provided dependency to include necessary annotations used by "reactor-core".
Expand Down
3 changes: 2 additions & 1 deletion sdk/cosmos/azure-cosmos/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Release History

## 4.4.0-beta.2 (Unreleased)

### Key Bug Fixes
* Fixed RequestTimeoutException when enable tcnative.

## 4.4.0-beta.1 (2020-08-27)
### New Features
Expand Down
6 changes: 0 additions & 6 deletions sdk/cosmos/azure-cosmos/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,6 @@ Licensed under the MIT License.
<groupId>com.azure</groupId>
<artifactId>azure-core</artifactId>
<version>1.7.0</version> <!-- {x-version-update;com.azure:azure-core;dependency} -->
<exclusions>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import io.netty.channel.pool.ChannelPool;
import io.netty.channel.pool.ChannelPoolHandler;
import io.netty.handler.logging.LoggingHandler;
import io.netty.handler.ssl.SslHandler;
import io.netty.handler.timeout.IdleStateHandler;
import io.netty.util.AttributeKey;
import org.slf4j.Logger;
Expand Down Expand Up @@ -113,7 +114,9 @@ protected void initChannel(final Channel channel) {
}

pipeline.addFirst(
this.config.sslContext().newHandler(channel.alloc()),
// TODO (DANOBLE) Log an issue with netty
// Initialize sslHandler with jdkCompatibilityMode = true for openssl context.
new SslHandler(this.config.sslContext().newEngine(channel.alloc())),
new IdleStateHandler(
idleConnectionTimerResolutionInNanos,
idleConnectionTimerResolutionInNanos,
Expand Down

0 comments on commit df5a8f4

Please sign in to comment.