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/src/IceGrid/Activator.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/src/IceGrid/Activator.cpp')
-rw-r--r-- | cpp/src/IceGrid/Activator.cpp | 21 |
1 files changed, 18 insertions, 3 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); |