Commit 82297c1c authored by unknown's avatar unknown
Browse files

BUG#11132 Connections stuck in CLOSE_WAIT

This fixes the problem in 5.0 in the correct way.

The previous patch (for 4.1) is only valid for 4.1 and is done at the right time
for 4.1.


ndb/src/kernel/main.cpp:
  The ndbd angel process keeps the mgm connection open as it retains a reference
  to the socket.
  
  this means that when the mgm server is killed, the socket stays in CLOSE_WAIT 
  (the ndb process will close() it okay in 5.0, as we reused it for a transporter
  but this isn't enough as the angel process still has a reference to that socket).
  
  so, by adding in a theConfig->closeConfiguration(); in the angel process, the ndb
  process is left with the only reference to the socket - which it can close whenever
  it likes (namely when the connection is terminated).
parent 7748d388
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -101,6 +101,12 @@ int main(int argc, char** argv)
     */
    catchsigs(true);

    /**
     * We no longer need the mgm connection in this process
     * (as we are the angel, not ndb)
     */
    theConfig->closeConfiguration();

    int status = 0;
    while(waitpid(child, &status, 0) != child);
    if(WIFEXITED(status)){