Use tasks by default when using openssl based SSL provider (#11242)

Motivation:

We introduced the ability to offload certain operations to an executor that may take some time to complete. At the moment this is not enabled by default when using the openssl based SSL provider. Let's enable it by default as we have this support for some while now and didnt see any issues yet. This will also make things less confusing and more consistent with the JDK based provider.

Modifications:

Use true as default value for io.netty.handler.ssl.openssl.useTasks.

Result:

Offloading works with openssl based SSL provider as well by default
This commit is contained in:
Norman Maurer 2021-05-12 15:01:02 +02:00 committed by GitHub
parent da2f7a414e
commit d0b7f76b9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -84,8 +84,9 @@ public abstract class ReferenceCountedOpenSslContext extends SslContext implemen
private static final int DEFAULT_BIO_NON_APPLICATION_BUFFER_SIZE = Math.max(1,
SystemPropertyUtil.getInt("io.netty.handler.ssl.openssl.bioNonApplicationBufferSize",
2048));
// Let's use tasks by default but still allow the user to disable it via system property just in case.
static final boolean USE_TASKS =
SystemPropertyUtil.getBoolean("io.netty.handler.ssl.openssl.useTasks", false);
SystemPropertyUtil.getBoolean("io.netty.handler.ssl.openssl.useTasks", true);
private static final Integer DH_KEY_LENGTH;
private static final ResourceLeakDetector<ReferenceCountedOpenSslContext> leakDetector =
ResourceLeakDetectorFactory.instance().newResourceLeakDetector(ReferenceCountedOpenSslContext.class);