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

Netty Client hold batch object until io operation complete

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.10.0
    • Fix Version/s: 0.10.0
    • Component/s: storm-core
    • Labels:
      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

            • Assignee:
              zhanghailei zhanghailei
              Reporter:
              zhanghailei zhanghailei

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment