giraph-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eli Reisman (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GIRAPH-437) Missing progress calls when stopping Netty server
Date Fri, 30 Nov 2012 19:57:58 GMT

    [ https://issues.apache.org/jira/browse/GIRAPH-437?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13507611#comment-13507611
] 

Eli Reisman commented on GIRAPH-437:
------------------------------------

You know the problem you're monitoring here, the lockup on awaitUniteruptably() for NettyServer,
might be caused by that call itself. This is how the NettyClient shuts down, perhaps this
is the pattern we need to add to the NettyServer ChannelGroup shutdown? There is more info
about this pattern and why to use it on the netty.io site. The snippet is part of the netty.io
way to avoid using awaitUninterruptably as in NettyServer. Here's the NettyClient#stop() method
for reference:

{code}
public void stop() {
    // Close connections asynchronously, in a Netty-approved
    // way, without cleaning up thread pools until all channels
    // in addressChannelMap are closed (success or failure)
    int channelCount = 0;
    for (ChannelRotater channelRotater : addressChannelMap.values()) {
      channelCount += channelRotater.size();
    }
    final int done = channelCount;
    final AtomicInteger count = new AtomicInteger(0);
    for (ChannelRotater channelRotater : addressChannelMap.values()) {
      channelRotater.closeChannels(new ChannelFutureListener() {
        @Override
        public void operationComplete(ChannelFuture cf) {
          context.progress();
          if (count.incrementAndGet() == done) {
            if (LOG.isInfoEnabled()) {
              LOG.info("stop: reached wait threshold, " +
                  done + " connections closed, releasing " +
                  "NettyClient.bootstrap resources now.");
            }
            bossExecutorService.shutdownNow();
            workerExecutorService.shutdownNow();
            bootstrap.releaseExternalResources();
          }
        }
      });
    }
  }
{code}

I might be way off here, but when I implemented the original version of this pattern I only
did it in one of the two files (Client not Server) so this could maybe be the reason for the
hangup in your logs? ...Or not! Anyway, just a thought. 
                
> Missing progress calls when stopping Netty server
> -------------------------------------------------
>
>                 Key: GIRAPH-437
>                 URL: https://issues.apache.org/jira/browse/GIRAPH-437
>             Project: Giraph
>          Issue Type: Improvement
>            Reporter: Maja Kabiljo
>            Assignee: Maja Kabiljo
>         Attachments: GIRAPH-437.patch
>
>
> At the end of a long running job I got an exception about not reporting progress. The
last log line was: "stop: Halting netty server", so I suspect it's because awaitUninterruptibly()
call there.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message