vldpyatkov commented on code in PR #6370:
URL: https://github.com/apache/ignite-3/pull/6370#discussion_r2262522429
##########
modules/client-handler/src/main/java/org/apache/ignite/client/handler/ClientInboundMessageHandler.java:
##########
@@ -460,17 +465,22 @@ private void handshake(ChannelHandlerContext ctx,
ClientMessageUnpacker unpacker
return;
}
- authenticationManager
-
.authenticateAsync(createAuthenticationRequest(clientHandshakeExtensions))
- .handleAsync((user, err) -> {
- if (err != null) {
- handshakeError(ctx, packer, err);
- } else {
- handshakeSuccess(ctx, packer, user,
clientFeatures, clientVer, clientCode);
- }
+
handshakeEventLoopSwitcher.switchEventLoopIfNeeded(channelHandlerContext.channel(),
+ () ->
authenticationManager.authenticateAsync(createAuthenticationRequest(clientHandshakeExtensions))
+ .handleAsync((user, err) -> {
+ if (err != null) {
+ handshakeError(ctx, packer, err);
+ } else {
+ handshakeSuccess(ctx, packer,
user, clientFeatures, clientVer, clientCode);
+ }
+
+ return null;
+ }, ctx.executor()))
+ .exceptionally(t -> {
Review Comment:
It is necessary to release context (avoid Netty leak) when an exception
happens on the switching event loop.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]