From: Tomek Mrugalski Date: Tue, 25 Aug 2015 14:12:40 +0000 (+0200) Subject: [4000] Changes after review: X-Git-Tag: trac4003_base~1^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=692f3dd0acd41ea0108aae77bc130e111a473ded;p=thirdparty%2Fkea.git [4000] Changes after review: - distinction between ISC and std exceptions removed. - reference to support ticket removed. --- diff --git a/src/bin/dhcp4/dhcp4_messages.mes b/src/bin/dhcp4/dhcp4_messages.mes index 5cb2bb1841..b269e024b5 100644 --- a/src/bin/dhcp4/dhcp4_messages.mes +++ b/src/bin/dhcp4/dhcp4_messages.mes @@ -201,12 +201,8 @@ from a client. Server does not process empty Hostname options and therefore option is skipped. The argument holds the client and transaction identification information. -% DHCP4_HANDLE_SIGNAL_EXCEPTION_ISC An ISC exception was thrown while handing signal: %1 -This error message is printed when an ISC exception was raised during signal -processing. This likely indicates a coding error and should be reported to ISC. - -% DHCP4_HANDLE_SIGNAL_EXCEPTION_STD An standard exception was thrown while handing signal: %1 -This error message is printed when a standard type exception was raised during signal +% DHCP4_HANDLE_SIGNAL_EXCEPTION An exception was thrown while handing signal: %1 +This error message is printed when an ISC or standard exception was raised during signal processing. This likely indicates a coding error and should be reported to ISC. % DHCP4_HOOKS_LIBS_RELOAD_FAIL reload of hooks libraries failed diff --git a/src/bin/dhcp4/dhcp4_srv.cc b/src/bin/dhcp4/dhcp4_srv.cc index f3ad0ca97e..634b0b2309 100644 --- a/src/bin/dhcp4/dhcp4_srv.cc +++ b/src/bin/dhcp4/dhcp4_srv.cc @@ -422,19 +422,10 @@ Dhcpv4Srv::run() { // of select() to terminate. try { handleSignal(); - } catch (const isc::Exception& e) { - // ISC-derived exception occurred. The nature of this exception - // indicates that it originated from ISC code. If this happens, - // it will be easy to fix as it is in the code that is under - // ISC control. - LOG_ERROR(dhcp4_logger, DHCP4_HANDLE_SIGNAL_EXCEPTION_ISC) - .arg(e.what()); } catch (const std::exception& e) { - // Standard exception occurred. The nature of this exception - // indicates that it was caused in non-ISC code. Fixing this - // issue will be somewhat more difficult than the one caused - // by ISC code. - LOG_ERROR(dhcp4_logger, DHCP4_HANDLE_SIGNAL_EXCEPTION_STD) + // Standard exception occurred. Let's be on the safe side to + // catch std::exception. + LOG_ERROR(dhcp4_logger, DHCP4_HANDLE_SIGNAL_EXCEPTION) .arg(e.what()); } diff --git a/src/bin/dhcp6/dhcp6_messages.mes b/src/bin/dhcp6/dhcp6_messages.mes index 1bc74200f2..28cacdefa7 100644 --- a/src/bin/dhcp6/dhcp6_messages.mes +++ b/src/bin/dhcp6/dhcp6_messages.mes @@ -242,12 +242,8 @@ probable if you see many such messages. Clients will recover from this, but they will most likely get a different IP addresses and experience a brief service interruption. -% DHCP6_HANDLE_SIGNAL_EXCEPTION_ISC An ISC exception was thrown while handing signal: %1 -This error message is printed when an ISC exception was raised during signal -processing. This likely indicates a coding error and should be reported to ISC. - -% DHCP6_HANDLE_SIGNAL_EXCEPTION_STD An standard exception was thrown while handing signal: %1 -This error message is printed when a standard type exception was raised during signal +% DHCP6_HANDLE_SIGNAL_EXCEPTION An exception was thrown while handing signal: %1 +This error message is printed when an exception was raised during signal processing. This likely indicates a coding error and should be reported to ISC. % DHCP6_HOOKS_LIBS_RELOAD_FAIL reload of hooks libraries failed diff --git a/src/bin/dhcp6/dhcp6_srv.cc b/src/bin/dhcp6/dhcp6_srv.cc index 54a36ca0b2..133fb3a380 100644 --- a/src/bin/dhcp6/dhcp6_srv.cc +++ b/src/bin/dhcp6/dhcp6_srv.cc @@ -384,23 +384,12 @@ bool Dhcpv6Srv::run() { // terminate. try { handleSignal(); - } catch (const isc::Exception& e) { - // ISC-derived exception occurred. The nature of this exception - // indicates that it originated from ISC code. If this happens, - // it will be easy to fix as it is in the code that is under - // ISC control. - LOG_ERROR(dhcp6_logger, DHCP6_HANDLE_SIGNAL_EXCEPTION_ISC) - .arg(e.what()); } catch (const std::exception& e) { - // Standard exception occurred. The nature of this exception - // indicates that it was caused in non-ISC code. Fixing this - // issue will be somewhat more difficult than the one caused - // by ISC code. - LOG_ERROR(dhcp6_logger, DHCP6_HANDLE_SIGNAL_EXCEPTION_STD) + // An (a standard or ISC) exception occurred. + LOG_ERROR(dhcp6_logger, DHCP6_HANDLE_SIGNAL_EXCEPTION) .arg(e.what()); } - // Execute ready timers for the lease database, e.g. Lease File Cleanup. try { LeaseMgrFactory::instance().getIOService()->poll(); diff --git a/src/lib/util/tests/process_spawn_unittest.cc b/src/lib/util/tests/process_spawn_unittest.cc index 1aea10df15..3e4186f602 100644 --- a/src/lib/util/tests/process_spawn_unittest.cc +++ b/src/lib/util/tests/process_spawn_unittest.cc @@ -232,9 +232,9 @@ TEST(ProcessSpawn, errnoInvariance) { EXPECT_EQ(64, process.getExitStatus(pid)); - // errno value should NOT be set to be preserved, despite the SIGCHILD + // errno value should be set to be preserved, despite the SIGCHILD // handler (ProcessSpawnImpl::waitForProcess) calling waitpid(), which - // will likely set errno to ECHILD. See trac4000 and support 8785. + // will likely set errno to ECHILD. See trac4000. EXPECT_EQ(123, errno); }