Github user satishd commented on a diff in the pull request:

    https://github.com/apache/storm/pull/1591#discussion_r73129527
  
    --- Diff: 
storm-core/src/jvm/org/apache/storm/messaging/netty/KerberosSaslClientHandler.java
 ---
    @@ -46,56 +44,48 @@ public KerberosSaslClientHandler(ISaslClient client, 
Map storm_conf, String jaas
         }
     
         @Override
    -    public void channelConnected(ChannelHandlerContext ctx,
    -                                 ChannelStateEvent event) {
    +    public void channelActive(ChannelHandlerContext ctx) throws Exception {
             // register the newly established channel
    -        Channel channel = ctx.getChannel();
    -        client.channelConnected(channel);
    +        Channel channel = ctx.channel();
    +        client.channelReady();
     
             LOG.info("Connection established from {} to {}",
    -                 channel.getLocalAddress(), channel.getRemoteAddress());
    +                 channel.localAddress(), channel.remoteAddress());
     
             try {
    -            KerberosSaslNettyClient saslNettyClient = 
KerberosSaslNettyClientState.getKerberosSaslNettyClient
    -                .get(channel);
    +            KerberosSaslNettyClient saslNettyClient = 
channel.attr(KerberosSaslNettyClientState.KERBEROS_SASL_NETTY_CLIENT).get();
     
                 if (saslNettyClient == null) {
                     LOG.debug("Creating saslNettyClient now for channel: {}",
                               channel);
                     saslNettyClient = new KerberosSaslNettyClient(storm_conf, 
jaas_section);
    -                
KerberosSaslNettyClientState.getKerberosSaslNettyClient.set(channel,
    -                                                                           
 saslNettyClient);
    +                
channel.attr(KerberosSaslNettyClientState.KERBEROS_SASL_NETTY_CLIENT).set(saslNettyClient);
                 }
                 LOG.debug("Going to initiate Kerberos negotiations.");
                 byte[] initialChallenge = saslNettyClient.saslResponse(new 
SaslMessageToken(new byte[0]));
                 LOG.debug("Sending initial challenge: {}", initialChallenge);
    -            channel.write(new SaslMessageToken(initialChallenge));
    +            channel.writeAndFlush(new SaslMessageToken(initialChallenge));
    --- End diff --
    
    Why is it changed to use `writeAndFlush`? 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to