4390: In DB Access process, recover the signal handle in %SIG which was cleaned up by accident. This fix should be removed if fixed the root cause of %SIG clean up.

This commit is contained in:
daniceexi 2014-11-24 09:41:43 -05:00
parent c21a1d35a2
commit 9d0b4b1be7

View File

@ -179,6 +179,10 @@ sub init_dbworker {
#setup signal in NotifHandler so that the cache can be updated
xCAT::NotifHandler::setup($$, 0);
# NOTE: There's a bug that sometimes the %SIG is cleaned up by accident, but we cannot figure out when and why
# this happens. The temporary fix is to backup the %SIG and recover it when necessary.
my %SIGbakup = %SIG;
while (not $exitdbthread) {
eval {
my @ready_socks = $clientset->can_read;
@ -191,6 +195,7 @@ sub init_dbworker {
} else {
eval {
handle_dbc_conn($currcon,$clientset);
unless (%SIG && defined ($SIG{USR1})) { %SIG = %SIGbakup; }
};
if ($@) {
my $err=$@;