Uploaded image for project: 'Apache Storm'
  1. Apache Storm
  2. STORM-835

Netty Client hold batch object until io operation complete

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 0.10.0
    • 0.10.0
    • storm-core
    • None

    Description

      Netty Client hold batch object until IO operation complete.
      Following code:

      Client.java
       final int numMessages = batch.size();
              pendingMessages.getAndAdd(numMessages);
              LOG.debug("writing {} messages to channel {}", batch.size(), channel.toString());
              ChannelFuture future = channel.write(batch);
              future.addListener(new ChannelFutureListener() {
      
                  public void operationComplete(ChannelFuture future) throws Exception {
                      pendingMessages.getAndAdd(0 - numMessages);
                      if (future.isSuccess()) {
                          LOG.debug("sent {} messages to {}", numMessages, dstAddressPrefixedName);
                          messagesSent.getAndAdd(batch.size());
                      }
      
      

      batch will be a field of anonymous inner classes.don't release after channel.write() invoked,until IO operation complete.

      Attachments

        Activity

          People

            zhanghailei zhanghailei
            zhanghailei zhanghailei
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: