Below is the list of changes that have just been committed into a local
5.0 repository of zhl. When zhl does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-03-12 16:56:19+00:00, lzhou@dev3-63.(none) +2 -0
BUG#24793 Add SO_KEEPALIVE socket option to avoid cluster nodes keeping dead connections
forever.
ndb/src/common/transporter/TCP_Transporter.cpp@stripped, 2007-03-12 16:56:14+00:00,
lzhou@dev3-63.(none) +8 -0
Add SO_KEEPALIVE socket option
ndb/src/common/transporter/TCP_Transporter.hpp@stripped, 2007-03-12 16:56:14+00:00,
lzhou@dev3-63.(none) +1 -0
Add a socket option variable
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: lzhou
# Host: dev3-63.(none)
# Root: /home/zhl/mysql/mysql-5.0/bug24793
--- 1.11/ndb/src/common/transporter/TCP_Transporter.cpp 2007-03-12 16:56:32 +00:00
+++ 1.12/ndb/src/common/transporter/TCP_Transporter.cpp 2007-03-12 16:56:32 +00:00
@@ -92,6 +92,7 @@ TCP_Transporter::TCP_Transporter(Transpo
sockOptSndBufSize = 71540;
sockOptNodelay = 1;
sockOptTcpMaxSeg = 4096;
+ sockOptKeepAlive = 1;
}
TCP_Transporter::~TCP_Transporter() {
@@ -169,6 +170,13 @@ TCP_Transporter::setSocketOptions(){
#endif
}//if
+ if (setsockopt(theSocket, SOL_SOCKET, SO_KEEPALIVE,
+ (char*)&sockOptKeepAlive, sizeof(sockOptKeepAlive)) < 0) {
+#ifdef DEBUG_TRANSPORTER
+ ndbout_c("The setsockopt SO_KEEPALIVE error code = %d", InetErrno);
+#endif
+ }//if
+
//-----------------------------------------------
// Set the TCP_NODELAY option so also small packets are sent
// as soon as possible
--- 1.6/ndb/src/common/transporter/TCP_Transporter.hpp 2007-03-12 16:56:32 +00:00
+++ 1.7/ndb/src/common/transporter/TCP_Transporter.hpp 2007-03-12 16:56:32 +00:00
@@ -135,6 +135,7 @@ private:
int sockOptSndBufSize;
int sockOptNodelay;
int sockOptTcpMaxSeg;
+ int sockOptKeepAlive;
void setSocketOptions();
| Thread |
|---|
| • bk commit into 5.0 tree (lzhou:1.2389) BUG#24793 | lzhou | 12 Mar |