Commit be7b7552 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[1546] delay listening to config/command from the module cc session

until the initial configuration is completed.  otherwise it confuses
communication with the socket creator and makes listen_on fail.
parent 17c32814
......@@ -209,9 +209,16 @@ main(int argc, char* argv[]) {
cc_session = new Session(io_service.get_io_service());
isc::server_common::initSocketReqeustor(*cc_session);
// We delay starting listening to new commands/config just before we
// go into the main loop to avoid confusion due to mixture of
// synchronous and asynchronous operations (this would happen in
// initial communication with the socket creator that takes place in
// updateConfig()). Until then all operations on the CC session will
// take place synchronously.
config_session = new ModuleCCSession(specfile, *cc_session,
my_config_handler,
my_command_handler);
my_command_handler, false);
LOG_DEBUG(resolver_logger, RESOLVER_DBG_INIT, RESOLVER_CONFIG_CHANNEL);
// FIXME: This does not belong here, but inside Boss
......@@ -229,6 +236,9 @@ main(int argc, char* argv[]) {
resolver->updateConfig(config_session->getFullConfig(), true);
LOG_DEBUG(resolver_logger, RESOLVER_DBG_INIT, RESOLVER_CONFIG_LOADED);
// Now start asynchronous read.
config_session->start();
LOG_INFO(resolver_logger, RESOLVER_STARTED);
io_service.run();
} catch (const std::exception& ex) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment