ext/common/UnionStation/Core.h in passenger-5.0.10 vs ext/common/UnionStation/Core.h in passenger-5.0.11

- old
+ new

@@ -143,21 +143,21 @@ // Create socket. fd = connectToServer(serverAddress, __FILE__, __LINE__); FdGuard guard(fd, NULL, 0, true); - P_LOG_FILE_DESCRIPTOR_PURPOSE(fd, "Connection to " AGENT_EXE " logger"); + P_LOG_FILE_DESCRIPTOR_PURPOSE(fd, "Connection to " SHORT_PROGRAM_NAME " UstRouter"); // Handshake: process protocol version number. if (!readArrayMessage(fd, args, &timeout)) { - throw IOException("The logging agent closed the connection before sending a version identifier."); + throw IOException("The UstRouter closed the connection before sending a version identifier."); } if (args.size() != 2 || args[0] != "version") { - throw IOException("The logging agent server didn't sent a valid version identifier."); + throw IOException("The UstRouter server didn't sent a valid version identifier."); } if (args[1] != "1") { - string message = "Unsupported logging agent protocol version " + + string message = "Unsupported UstRouter protocol version " + args[1] + "."; throw IOException(message); } // Handshake: authenticate. @@ -165,28 +165,28 @@ writeScalarMessage(fd, username, &timeout); writeScalarMessage(fd, password, &timeout); UPDATE_TRACE_POINT(); if (!readArrayMessage(fd, args, &timeout)) { - throw IOException("The logging agent did not send an authentication response."); + throw IOException("The UstRouter did not send an authentication response."); } else if (args.size() != 1) { - throw IOException("The authentication response that the logging agent sent is not valid."); + throw IOException("The authentication response that the UstRouter sent is not valid."); } else if (args[0] != "ok") { - throw SecurityException("The logging agent server denied authentication: " + args[0]); + throw SecurityException("The UstRouter server denied authentication: " + args[0]); } // Initialize session. UPDATE_TRACE_POINT(); writeArrayMessage(fd, &timeout, "init", nodeName.c_str(), NULL); if (!readArrayMessage(fd, args, &timeout)) { - throw SystemException("Cannot connect to logging server", ECONNREFUSED); + throw SystemException("Cannot connect to the UstRouter", ECONNREFUSED); } else if (args.size() != 1) { - throw IOException("Logging server returned an invalid reply for the 'init' command"); + throw IOException("UstRouter returned an invalid reply for the 'init' command"); } else if (args[0] == "server shutting down") { throw SystemException("Cannot connect to server", ECONNREFUSED); } else if (args[0] != "ok") { - throw IOException("Logging server returned an invalid reply for the 'init' command"); + throw IOException("UstRouter returned an invalid reply for the 'init' command"); } ConnectionPtr connection = boost::make_shared<Connection>(fd); guard.clear(); return connection; @@ -224,25 +224,25 @@ P_TRACE(3, "Not yet time to reconnect; returning NULL connection"); return ConnectionPtr(); } l.unlock(); - P_TRACE(3, "Creating new connection with logging agent"); + P_TRACE(3, "Creating new connection with UstRouter"); ConnectionPtr connection; try { connection = createNewConnection(); } catch (const TimeoutException &) { l.lock(); - P_WARN("Timeout trying to connect to the logging agent at " << serverAddress << "; " << + P_WARN("Timeout trying to connect to the UstRouter at " << serverAddress << "; " << "will reconnect in " << reconnectTimeout / 1000000 << " second(s)."); nextReconnectTime = SystemTime::getUsec() + reconnectTimeout; return ConnectionPtr(); } catch (const tracable_exception &e) { l.lock(); nextReconnectTime = SystemTime::getUsec() + reconnectTimeout; if (instanceof<IOException>(e) || instanceof<SystemException>(e)) { - P_WARN("Cannot connect to the logging agent at " << serverAddress << + P_WARN("Cannot connect to the UstRouter at " << serverAddress << " (" << e.what() << "); will reconnect in " << reconnectTimeout / 1000000 << " second(s)."); return ConnectionPtr(); } else { throw; @@ -283,27 +283,27 @@ if (expectAck) { vector<string> args; if (!readArrayMessage(connection->fd, args, &timeout)) { boost::lock_guard<boost::mutex> l(syncher); - P_WARN("The logging agent at " << serverAddress << + P_WARN("The UstRouter at " << serverAddress << " closed the connection (no error message given);" << " will reconnect in " << reconnectTimeout / 1000000 << " second(s)."); nextReconnectTime = SystemTime::getUsec() + reconnectTimeout; return false; } else if (args.size() == 2 && args[0] == "error") { boost::lock_guard<boost::mutex> l(syncher); - P_WARN("The logging agent at " << serverAddress << + P_WARN("The UstRouter at " << serverAddress << " closed the connection (error message: " << args[1] << "); will reconnect in " << reconnectTimeout / 1000000 << " second(s)."); nextReconnectTime = SystemTime::getUsec() + reconnectTimeout; return false; } else if (args.empty() || args[0] != "ok") { boost::lock_guard<boost::mutex> l(syncher); - P_WARN("The logging agent at " << serverAddress << + P_WARN("The UstRouter at " << serverAddress << " sent an unexpected reply;" << " will reconnect in " << reconnectTimeout / 1000000 << " second(s)."); nextReconnectTime = SystemTime::getUsec() + reconnectTimeout; return false; @@ -313,11 +313,11 @@ guard.clear(); return true; } catch (const TimeoutException &) { boost::lock_guard<boost::mutex> l(syncher); - P_WARN("Timeout trying to communicate with the logging agent at " << serverAddress << "; " << + P_WARN("Timeout trying to communicate with the UstRouter at " << serverAddress << "; " << "will reconnect in " << reconnectTimeout / 1000000 << " second(s)."); nextReconnectTime = SystemTime::getUsec() + reconnectTimeout; return false; } catch (const SystemException &e) { @@ -327,16 +327,16 @@ guard.clear(); gotErrorResponse = connection->disconnect(errorResponse); boost::lock_guard<boost::mutex> l(syncher); if (gotErrorResponse) { - P_WARN("The logging agent at " << serverAddress << + P_WARN("The UstRouter at " << serverAddress << " closed the connection (error message: " << errorResponse << "); will reconnect in " << reconnectTimeout / 1000000 << " second(s)."); } else { - P_WARN("The logging agent at " << serverAddress << + P_WARN("The UstRouter at " << serverAddress << " closed the connection (no error message given);" << " will reconnect in " << reconnectTimeout / 1000000 << " second(s)."); } nextReconnectTime = SystemTime::getUsec() + reconnectTimeout; @@ -378,11 +378,11 @@ StaticString("true", 4), // ack filters }; unsigned int nparams = sizeof(params) / sizeof(StaticString); - // Get a connection to the logging server. + // Get a connection to the UstRouter. ConnectionPtr connection = checkoutConnection(); if (connection == NULL) { P_TRACE(2, "Created NULL Union Station transaction: group=" << groupName << ", category=" << category << ", txnId=" << StaticString(txnId, txnIdEnd - txnId)); @@ -438,10 +438,10 @@ StaticString("true", 4), // crashProtect StaticString("false", 4) // ack }; unsigned int nparams = sizeof(params) / sizeof(StaticString); - // Get a connection to the logging server. + // Get a connection to the UstRouter. ConnectionPtr connection = checkoutConnection(); if (connection == NULL) { return createNullTransaction(); }