[freeside-commits] freeside/FS/bin freeside-selfservice-xmlrpcd, 1.1.2.9, 1.1.2.10
Ivan,,,
ivan at wavetail.420.am
Fri Jul 2 21:20:03 PDT 2010
Update of /home/cvs/cvsroot/freeside/FS/bin
In directory wavetail.420.am:/tmp/cvs-serv28313
Modified Files:
Tag: FREESIDE_1_9_BRANCH
freeside-selfservice-xmlrpcd
Log Message:
fix leaking db connections in freeside-selfservice-xmlrpcd, RT#7780
Index: freeside-selfservice-xmlrpcd
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/bin/freeside-selfservice-xmlrpcd,v
retrieving revision 1.1.2.9
retrieving revision 1.1.2.10
diff -u -w -d -r1.1.2.9 -r1.1.2.10
--- freeside-selfservice-xmlrpcd 22 Jun 2010 01:26:01 -0000 1.1.2.9
+++ freeside-selfservice-xmlrpcd 3 Jul 2010 04:20:01 -0000 1.1.2.10
@@ -24,7 +24,7 @@
use XMLRPC::Lite; # for XMLRPC::Serializer
use FS::Daemon qw(daemonize1 drop_root logfile daemonize2 );
-use FS::UID qw(adminsuidsetup forksuidsetup);
+use FS::UID qw( adminsuidsetup forksuidsetup dbh );
use FS::Conf;
use FS::ClientAPI;
use FS::ClientAPI_XMLRPC; #FS::SelfService::XMLRPC;
@@ -66,6 +66,10 @@
die "not running; selfservice-xmlrpc conf option is off\n"
unless $conf->exists('selfservice-xmlrpc');
+#parent doesn't need to hold a DB connection open
+dbh->disconnect;
+undef $FS::UID::dbh;
+
###
# the main loop
###
@@ -184,6 +188,9 @@
$heap->{is_a_child} = 1;
$heap->{children} = {};
+ #freeside db connection, etc.
+ forksuidsetup($user);
+
return;
}
}
@@ -278,7 +285,7 @@
sub client_got_request {
my ( $heap, $request ) = @_[ HEAP, ARG0 ];
- freeside_kid_time();
+ forksuidsetup($user) unless dbh && dbh->ping;
my $serializer = new XMLRPC::Serializer(typelookup => \%typelookup);
@@ -303,18 +310,6 @@
$heap->{client}->put($response);
}
-#setup the database connection and other things FS::SelfService::XMLRPC
-#expects to be in place. aka "kid time" in freeside-selfservice-server
-sub freeside_kid_time {
-
- #we did need a db connection in the parent, so
- ##get new db handle
- $FS::UID::dbh->{InactiveDestroy} = 1;
- forksuidsetup($user);
-
- #i guess that was it
-}
-
### The client handler received an error. Stop the ReadWrite wheel,
### which also closes the socket.
More information about the freeside-commits
mailing list