Skip to content

Commit

Permalink
Fixed NPE when closing batch during a reconnection (apache#4427)
Browse files Browse the repository at this point in the history
  • Loading branch information
merlimat authored Jun 1, 2019
1 parent c73c71e commit 2a5b772
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1322,11 +1322,12 @@ private void batchMessageAndSend() {

pendingMessages.put(op);

ClientCnx cnx = cnx();
if (isConnected()) {
// If we do have a connection, the message is sent immediately, otherwise we'll try again once a new
// connection is established
cmd.retain();
cnx().ctx().channel().eventLoop().execute(WriteInEventLoopCallback.create(this, cnx(), op));
cnx.ctx().channel().eventLoop().execute(WriteInEventLoopCallback.create(this, cnx, op));
stats.updateNumMsgsSent(numMessagesInBatch, op.batchSizeByte);
} else {
if (log.isDebugEnabled()) {
Expand Down

0 comments on commit 2a5b772

Please sign in to comment.