ret = EXIT_FAILURE;
}
+ CtrlAgentController::instance().reset();
+
return (ret);
}
}
D2Process::~D2Process() {
-};
+}
D2CfgMgrPtr
D2Process::getD2CfgMgr() {
ret = EXIT_FAILURE;
}
+ D2Controller::instance().reset();
+
return (ret);
}
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#include <config.h>
+
#include <d2/dns_client.h>
#include <dns/opcode.h>
#include <asiodns/io_fetch.h>
#include <asiodns/logger.h>
#include <asiolink/interval_timer.h>
#include <dns/messagerenderer.h>
+#include <nc_test_utils.h>
+#include <stats_test_utils.h>
+
#include <boost/asio/ip/udp.hpp>
#include <boost/asio/socket_base.hpp>
#include <boost/scoped_ptr.hpp>
-#include <gtest/gtest.h>
-#include <nc_test_utils.h>
-#include <stats_test_utils.h>
#include <functional>
+#include <gtest/gtest.h>
+
using namespace std;
using namespace isc;
using namespace isc::asiolink;
}
// A response message is now ready to send. Send it!
socket->send_to(boost::asio::buffer(response_buf.getData(),
- response_buf.getLength()),
+ response_buf.getLength()),
*remote);
}
TSIGContextPtr context;
if (client_key) {
- context.reset(new TSIGContext(*client_key));
+ context = client_key->createContext();
}
isc::util::InputBuffer received_data_buffer(receive_buffer_,
// ensure that doUpdate doesn't throw an exception for valid timeouts.
unsigned int timeout = DNSClient::getMaxTimeout();
EXPECT_NO_THROW(dns_client_->doUpdate(service_, IOAddress(TEST_ADDRESS),
- TEST_PORT, message, timeout));
+ TEST_PORT, message, timeout));
// Cross the limit and expect that exception is thrown this time.
timeout = DNSClient::getMaxTimeout() + 1;
const int timeout = 500;
expected_++;
dns_client_->doUpdate(service_, IOAddress(TEST_ADDRESS), TEST_PORT,
- message, timeout);
+ message, timeout);
// It is possible to request that two packets are sent concurrently.
if (two_sends) {
// Performs a single request-response exchange with or without TSIG
//
// @param client_key TSIG passed to dns_client and also used by the
- // ""server" to verify the request.
+ // "server" to verify the request.
// request.
// @param server_key TSIG key the "server" should use to sign the response.
// If this is NULL, then client_key is used.
ret = EXIT_FAILURE;
}
+ NetconfController::instance().reset();
+
return (ret);
}
#include <cc/command_interpreter.h>
#include <cfgrpt/config_report.h>
#include <exceptions/exceptions.h>
+#include <hooks/hooks_manager.h>
#include <log/logger.h>
#include <log/logger_support.h>
#include <process/daemon.h>
using namespace isc::asiolink;
using namespace isc::data;
using namespace isc::config;
+using namespace isc::hooks;
namespace ph = std::placeholders;
namespace isc {
}
DControllerBase::~DControllerBase() {
+ // Explicitly unload hooks
+ HooksManager::prepareUnloadLibraries();
+ if (!HooksManager::unloadLibraries()) {
+ auto names = HooksManager::getLibraryNames();
+ std::string msg;
+ if (!names.empty()) {
+ msg = names[0];
+ for (size_t i = 1; i < names.size(); ++i) {
+ msg += std::string(", ") + names[i];
+ }
+ }
+ LOG_ERROR(dctl_logger, DCTL_UNLOAD_LIBRARIES_ERROR).arg(msg);
+ }
}
// Refer to config_report so it will be embedded in the binary
extern const isc::log::MessageID DCTL_SHUTDOWN_SIGNAL_RECVD = "DCTL_SHUTDOWN_SIGNAL_RECVD";
extern const isc::log::MessageID DCTL_STANDALONE = "DCTL_STANDALONE";
extern const isc::log::MessageID DCTL_STARTING = "DCTL_STARTING";
+extern const isc::log::MessageID DCTL_UNLOAD_LIBRARIES_ERROR = "DCTL_UNLOAD_LIBRARIES_ERROR";
extern const isc::log::MessageID DCTL_UNSUPPORTED_SIGNAL = "DCTL_UNSUPPORTED_SIGNAL";
} // namespace process
"DCTL_SHUTDOWN_SIGNAL_RECVD", "OS signal %1 received, starting shutdown",
"DCTL_STANDALONE", "%1 skipping message queue, running standalone",
"DCTL_STARTING", "%1 starting, pid: %2, version: %3 (%4)",
+ "DCTL_UNLOAD_LIBRARIES_ERROR", "error unloading hooks libraries during shutdown: %1",
"DCTL_UNSUPPORTED_SIGNAL", "ignoring reception of unsupported signal: %1",
NULL
};
extern const isc::log::MessageID DCTL_SHUTDOWN_SIGNAL_RECVD;
extern const isc::log::MessageID DCTL_STANDALONE;
extern const isc::log::MessageID DCTL_STARTING;
+extern const isc::log::MessageID DCTL_UNLOAD_LIBRARIES_ERROR;
extern const isc::log::MessageID DCTL_UNSUPPORTED_SIGNAL;
} // namespace process
This error message is issued if the controller could not initialize the
application and will exit.
+% DCTL_UNLOAD_LIBRARIES_ERROR error unloading hooks libraries during shutdown: %1
+This error message indicates that during shutdown, unloading hooks
+libraries failed to close them. If the list of libraries is empty it is
+a programmatic error in the server code. If it is not empty it could be
+a programmatic error in one of the hooks libraries which could lead to
+a crash during finalization.
+
% DCTL_NOT_RUNNING %1 application instance is not running
A warning message is issued when an attempt is made to shut down the
application when it is not running.