Skip to content

Commit b080e7d

Browse files
author
Ole John Aske
committed
Bug#35702079 Need to keep transporter sendbuffers updated during onging disconnect
If TCP_transported::doSend() encounted an error requiring a disconnect to be initiated, it returned immediately without updating the send buffers with the data it had already sent. It also returned 'true', which indicate that doSend() need to be retried. As transporter disconnection is an asynchronous process we can not rule out that another doSend() will be retried before the disconnection has reached a state where more sends will be prevented. (Not sure if that will ever succeed though) In the meantime it is a good idea to still keep the send buffers updated. Patch breaks out of the send loop instead of doing an immediate return. Thus the code maintaining the send buffers with 'sum_sent' will be executed. Change-Id: Id81134c9db670041613cd02641a7963d43766a3c
1 parent 0f7168f commit b080e7d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

storage/ndb/src/common/transporter/TCP_Transporter.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,11 +495,13 @@ TCP_Transporter::doSend(bool need_wakeup)
495495
}
496496
if ((DISCONNECT_ERRNO(err, nBytesSent)))
497497
{
498+
remain = 0; //Will stop retries of this send.
498499
if (!do_disconnect(err, true)) //Initiate pending disconnect
499500
{
500-
return true;
501+
// We are 'DISCONNECTING' asynch -> We may still attempt more sends.
502+
// -> The send buffers still need to be maintained with the 'sum_sent'
503+
// Fall through to break the send loop below.
501504
}
502-
remain = 0;
503505
}
504506
break;
505507
}

0 commit comments

Comments
 (0)