From 9d0b4b1be73c2783cc1a85a524cf866501d46f76 Mon Sep 17 00:00:00 2001 From: daniceexi Date: Mon, 24 Nov 2014 09:41:43 -0500 Subject: [PATCH] 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. --- perl-xCAT/xCAT/Table.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/perl-xCAT/xCAT/Table.pm b/perl-xCAT/xCAT/Table.pm index 474e4c8d0..706c08e77 100644 --- a/perl-xCAT/xCAT/Table.pm +++ b/perl-xCAT/xCAT/Table.pm @@ -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=$@;