merlimat commented on issue #1241: NullPointerException in 
PerChannelBookieClient
URL: https://github.com/apache/bookkeeper/issues/1241#issuecomment-371908810
 
 
   I think this was added in f3166dde6f0429be121110ee534a5574d136248a
   
   A portion of that commit: 
   ```diff
   @@ -861,7 +875,21 @@ public class PerChannelBookieClient extends 
ChannelInboundHandlerAdapter {
            }
   
            try {
   -            channel.writeAndFlush(request, channel.voidPromise());
   +            final long startTime = MathUtils.nowInNano();
   +            ChannelFuture future = channel.writeAndFlush(request);
   +            future.addListener(new ChannelFutureListener() {
   +                @Override
   +                public void operationComplete(ChannelFuture future) throws 
Exception {
   +                    if (future.isSuccess()) {
   +                        
nettyOpLogger.registerSuccessfulEvent(MathUtils.elapsedNanos(startTime),
   +                                TimeUnit.NANOSECONDS);
   +                        completionObjects.get(key).setOutstanding();
   +                    } else {
   +                        
nettyOpLogger.registerFailedEvent(MathUtils.elapsedNanos(startTime),
   +                                TimeUnit.NANOSECONDS);
   +                    }
   +                }
   +            });
            } catch (Throwable e) {
                LOG.warn("Operation {} failed", requestToString(request), e);
                errorOut(key);
   ```
   
   ```java
    completionObjects.get(key).setOutstanding();
   ```
   
   This should be checking the completion object is not null.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to