Skip to content
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

Adding sys prop to enable heap pools with JDK SSL #5316

Draft
wants to merge 1 commit into
base: 4.x
Choose a base branch
from

Conversation

franz1981
Copy link
Contributor

SSL JDK can really be a memory hell, see netty/netty#14208: using unpooled buffers means trouble - but still there are users which "maybe" want to keep things as they are.

I've created an "hidden" property (which should become the default in vertx 5 really...) to have forcibly pooling of heap buffers using JDK SSL, but, by default it will keep the behaviour as it is.

@franz1981
Copy link
Contributor Author

@cescoffier and @vietj PTAL

I've added some asserts to make it existing tests to fail and make sure the invariant I'm assuming for SSL on vertx are correct.

@@ -57,6 +61,40 @@ public class SSLHelper {
CLIENT_AUTH_MAPPING.put(ClientAuth.NONE, io.netty.handler.ssl.ClientAuth.NONE);
}

ByteBufAllocator clientByteBufAllocator(SslChannelProvider sslChannelProvider) {
assert sslChannelProvider != null && sslChannelProvider.sslContextProvider() != null &&
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vietj these are here to compensate to lack of tests here: these should fail in the CI even if the sys prop is not used, so we know that the assumption, while enabled, is broken

@franz1981
Copy link
Contributor Author

@cescoffier this is key for both https and vertx sql client - cause the latter will rely heavily on it for the reactive sql drivers (both mysql and postgres AFAIK) -

@tsegismont AFAIK vertx sql driver should rely on NetClientImpl e.g. https://github.com/eclipse-vertx/vertx-sql-client/blob/master/vertx-sql-client/src/main/java/io/vertx/sqlclient/impl/ConnectionFactoryBase.java#L45
hence I would expect that the changes on NetClientImpl's allocator should just do "the right thing", wdyt?

@franz1981 franz1981 marked this pull request as draft September 17, 2024 08:50
@franz1981
Copy link
Contributor Author

After talking with @cescoffier I'm changing this back to use a specific option to enable this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant