[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mysql-internals
Subject:    bk commit into 5.0 tree (stewart:1.1852) BUG#10950
From:       Stewart Smith <stewart () mysql ! com>
Date:       2005-06-30 13:23:19
Message-ID: 20050630132319.7B7C71C23C00 () kennedy ! flamingspork ! com
[Download RAW message or body]

Below is the list of changes that have just been committed into a local
5.0 repository of stewart. When stewart 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
  1.1852 05/06/30 23:22:58 stewart@mysql.com +2 -0
  BUG#10950 Occational 'Error in mgm protocol parser' error on mysqld startup
  
  Display the (more commonly accurate) message that the mgm server closed our connection
  and that we'll retry connecting to it.

  ndb/src/mgmapi/mgmapi.cpp
    1.48 05/06/30 23:22:47 stewart@mysql.com +31 -9
    Only display a mgm protocol error in the case of the mgm server having disconnected.
    
    Change ndb_mgm_is_connected to actually poll the socket to see if it's still open.

  ndb/src/common/transporter/TransporterRegistry.cpp
    1.54 05/06/30 23:22:47 stewart@mysql.com +7 -1
    Fix error message in case of mgm disconnecting before we finished asking it for dynamic ports

# 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:	stewart
# Host:	kennedy.(none)
# Root:	/home/stewart/Documents/MySQL/5.0/ndb

--- 1.53/ndb/src/common/transporter/TransporterRegistry.cpp	2005-05-27 06:07:29 +10:00
+++ 1.54/ndb/src/common/transporter/TransporterRegistry.cpp	2005-06-30 23:22:47 +10:00
@@ -1284,10 +1284,16 @@
 		if (server_port)
 		  t->set_s_port(server_port);
 	      }
-	      else
+	      else if(ndb_mgm_is_connected(m_mgm_handle))
 	      {
 		ndbout_c("Failed to get dynamic port to connect to: %d", res);
 		ndb_mgm_disconnect(m_mgm_handle);
+	      }
+	      else
+	      {
+		ndbout_c("Management server closed connection early. "
+			 "It is probably being shut down (or has crashed). "
+			 "We will retry the connection.");
 	      }
 	    }
 	    /** else

--- 1.47/ndb/src/mgmapi/mgmapi.cpp	2005-05-10 20:33:41 +10:00
+++ 1.48/ndb/src/mgmapi/mgmapi.cpp	2005-06-30 23:22:47 +10:00
@@ -323,16 +323,22 @@
 
   const Properties* p = parser.parse(ctx, session);
   if (p == NULL){
-    /**
-     * Print some info about why the parser returns NULL
-     */
-    ndbout << "Error in mgm protocol parser. "
-	   << "cmd: '" << cmd
-	   << "' status=" << (Uint32)ctx.m_status
-	   << ", curr=" << ctx.m_currentToken
+    if(!ndb_mgm_is_connected(handle)) {
+      return NULL;
+    }
+    else
+    {
+      /**
+       * Print some info about why the parser returns NULL
+       */
+      ndbout << "Error in mgm protocol parser. "
+	     << "cmd: '" << cmd
+	     << "' status=" << (Uint32)ctx.m_status
+	     << ", curr=" << ctx.m_currentToken
 	   << endl;
-    DBUG_PRINT("info",("parser.parse returned NULL"));
-  } 
+      DBUG_PRINT("info",("parser.parse returned NULL"));
+    }
+  }
 #ifdef MGMAPI_LOG
   else {
     /** 
@@ -350,8 +356,24 @@
 extern "C"
 int ndb_mgm_is_connected(NdbMgmHandle handle)
 {
+  struct pollfd pfd[1];
+  int r;
+
   if(!handle)
     return 0;
+
+  if(handle->connected)
+  {
+    pfd[0].fd= handle->socket;
+    pfd[0].events= POLLHUP | POLLIN | POLLOUT | POLLNVAL;
+    pfd[0].revents= 0;
+    r= poll(pfd,1,0);
+    if(pfd[0].revents & POLLHUP)
+    {
+      handle->connected= 0;
+      NDB_CLOSE_SOCKET(handle->socket);
+    }
+  }
   return handle->connected;
 }
 

-- 
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe:    http://lists.mysql.com/internals?unsub=mysql-internals@progressive-comp.com

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic