diff options
author | Benoit Foucher <benoit@zeroc.com> | 2019-09-27 19:42:34 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2019-09-27 19:42:34 +0200 |
commit | 25894f25fd499207adba63f9e9b3e906f2a46f16 (patch) | |
tree | 18d5722fd05ba3b33852b9da31f98554dfb996fc /cpp | |
parent | Rationalize C# build target names (diff) | |
download | ice-25894f25fd499207adba63f9e9b3e906f2a46f16.tar.bz2 ice-25894f25fd499207adba63f9e9b3e906f2a46f16.tar.xz ice-25894f25fd499207adba63f9e9b3e906f2a46f16.zip |
Fixed IceGrid node to warn on errors to activate server, fixes #556
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/src/IceGrid/Activator.cpp | 21 | ||||
-rw-r--r-- | cpp/src/IceGrid/ServerI.cpp | 4 |
2 files changed, 20 insertions, 5 deletions
diff --git a/cpp/src/IceGrid/Activator.cpp b/cpp/src/IceGrid/Activator.cpp index 6f4ce63d1ea..f6087267c81 100644 --- a/cpp/src/IceGrid/Activator.cpp +++ b/cpp/src/IceGrid/Activator.cpp @@ -82,7 +82,7 @@ reportChildError(int err, int fd, const char* cannot, const char* name, const Tr os << cannot << " `" << name << "'"; if(err) { - os << ": " << IceUtilInternal::errorToString(err) << endl; + os << ": " << IceUtilInternal::errorToString(err); } const string msg = os.str(); ssize_t sz = write(fd, msg.c_str(), msg.size()); @@ -601,7 +601,12 @@ Activator::activate(const string& name, if(!b) { - throw runtime_error(IceUtilInternal::lastErrorToString()); + string message = IceUtilInternal::lastErrorToString(); + + Ice::Warning out(_traceLevels->logger); + out << "server activation failed for `" << name << "':\n" << message; + + throw runtime_error(message); } // @@ -619,7 +624,14 @@ Activator::activate(const string& name, if(!RegisterWaitForSingleObject(&pp->waithnd, pp->hnd, activatorWaitCallback, pp, INFINITE, WT_EXECUTEDEFAULT | WT_EXECUTEONLYONCE)) { - throw IceUtilInternal::lastErrorToString(); + TerminateProcess(pp->hnd, 0); + + string message = IceUtilInternal::lastErrorToString(); + + Ice::Warning out(_traceLevels->logger); + out << "server activation failed for `" << name << "':\ncouldn't register wait callback\n" << message; + + throw runtime_error(message); } // @@ -878,6 +890,9 @@ Activator::activate(const string& name, // if(!message.empty()) { + Ice::Warning out(_traceLevels->logger); + out << "server activation failed for `" << name << "':\n" << message; + close(fds[0]); close(errorFds[0]); waitPid(pid); diff --git a/cpp/src/IceGrid/ServerI.cpp b/cpp/src/IceGrid/ServerI.cpp index bb81379349b..2f70ba75c07 100644 --- a/cpp/src/IceGrid/ServerI.cpp +++ b/cpp/src/IceGrid/ServerI.cpp @@ -3005,7 +3005,7 @@ ServerI::setStateNoSync(InternalServerState st, const std::string& reason) } else if(_state == ServerI::Inactive) { - if(_node->getTraceLevels()->server != 2 && !(previous == ServerI::Loading || previous == ServerI::Patching)) + if(_node->getTraceLevels()->server > 2 || (previous != ServerI::Loading && previous != ServerI::Patching)) { out << "changed server `" << _id << "' state to `Inactive'"; } @@ -3046,7 +3046,7 @@ ServerI::setStateNoSync(InternalServerState st, const std::string& reason) } else if(_state == ServerI::Patching) { - out << "changed server `" << _id << "' state to `Loading'"; + out << "changed server `" << _id << "' state to `Patching'"; } } if(!reason.empty()) |