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);
TBUnixGroupList TBOSID TBOSMaxConcurrent TBOSCountInstances
TBResolveNextOSID TBOsidToPid
TBOSLoadMaxOkay TBImageLoadMaxOkay TBImageID ExpSwapper
TBdbfork VnameToNodeid TBExpLocked
TBdbfork TBDBDisconnect VnameToNodeid TBExpLocked
TBIsNodeRemote TBExptSetLogFile TBExptClearLogFile TBExptGetLogFile
TBIsNodeVirtual TBControlNetIP TBPhysNodeID
TBExptOpenLogFile TBExptCloseLogFile TBExptCreateLogFile
......@@ -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.
#
......
......@@ -2,7 +2,7 @@
#
# 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.
#
......@@ -136,4 +136,7 @@ else {
if ($debug) {
print "@cmdargs\n";
}
# Close our connection the DB to avoid holding open connections.
TBDBDisconnect();
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