Commit ee9937d3 authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Add a DB disconnect routine to the library, and call it from sshtb

before the exec to avoid holding open the mysqld socket in the new
process.
parent 2b84369d
...@@ -156,7 +156,7 @@ use vars qw(@ISA @EXPORT); ...@@ -156,7 +156,7 @@ use vars qw(@ISA @EXPORT);
TBUnixGroupList TBOSID TBOSMaxConcurrent TBOSCountInstances TBUnixGroupList TBOSID TBOSMaxConcurrent TBOSCountInstances
TBResolveNextOSID TBOsidToPid TBResolveNextOSID TBOsidToPid
TBOSLoadMaxOkay TBImageLoadMaxOkay TBImageID ExpSwapper TBOSLoadMaxOkay TBImageLoadMaxOkay TBImageID ExpSwapper
TBdbfork VnameToNodeid TBExpLocked TBdbfork TBDBDisconnect VnameToNodeid TBExpLocked
TBIsNodeRemote TBExptSetLogFile TBExptClearLogFile TBExptGetLogFile TBIsNodeRemote TBExptSetLogFile TBExptClearLogFile TBExptGetLogFile
TBIsNodeVirtual TBControlNetIP TBPhysNodeID TBIsNodeVirtual TBControlNetIP TBPhysNodeID
TBExptOpenLogFile TBExptCloseLogFile TBExptCreateLogFile TBExptOpenLogFile TBExptCloseLogFile TBExptCreateLogFile
...@@ -295,6 +295,13 @@ sub TBdbfork() ...@@ -295,6 +295,13 @@ sub TBdbfork()
} }
} }
# To avoid keeping a mysql connection around.
sub TBDBDisconnect()
{
undef($DB);
select(undef, undef, undef, 0.3);
}
# #
# Record last DB error string. # Record last DB error string.
# #
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# #
# EMULAB-COPYRIGHT # EMULAB-COPYRIGHT
# Copyright (c) 2000-2002, 2004 University of Utah and the Flux Group. # Copyright (c) 2000-2002, 2004, 2005 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
...@@ -136,4 +136,7 @@ else { ...@@ -136,4 +136,7 @@ else {
if ($debug) { if ($debug) {
print "@cmdargs\n"; print "@cmdargs\n";
} }
# Close our connection the DB to avoid holding open connections.
TBDBDisconnect();
exec(@cmdargs); exec(@cmdargs);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment