You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by al...@apache.org on 2018/01/11 12:07:51 UTC

mesos git commit: Logged socket create/connect failures on warning level.

Repository: mesos
Updated Branches:
  refs/heads/master 164d99e1b -> 9c03a463c


Logged socket create/connect failures on warning level.

If a socket create or connect failure occurs during link() or send(),
the reason for error is not propagated to the library user. Also, the
data being sent or queued is silently dropped on the floor. The socket
code does not log itself on a higher level when an error situation
occurs. The only trace is the log entries touched in this patch:
having them at warning level will significantly simplify debugging.

This patch also consistently logs send / link target.

Review: https://reviews.apache.org/r/65048/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/9c03a463
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/9c03a463
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/9c03a463

Branch: refs/heads/master
Commit: 9c03a463c1ac8f63dc00255945a04016c45f04e9
Parents: 164d99e
Author: Alexander Rukletsov <ru...@gmail.com>
Authored: Thu Jan 11 13:07:29 2018 +0100
Committer: Alexander Rukletsov <al...@apache.org>
Committed: Thu Jan 11 13:07:29 2018 +0100

----------------------------------------------------------------------
 3rdparty/libprocess/src/process.cpp | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/9c03a463/3rdparty/libprocess/src/process.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/process.cpp b/3rdparty/libprocess/src/process.cpp
index 53969a7..9d7a556 100644
--- a/3rdparty/libprocess/src/process.cpp
+++ b/3rdparty/libprocess/src/process.cpp
@@ -1410,7 +1410,8 @@ void SocketManager::link_connect(
 {
   if (future.isDiscarded() || future.isFailed()) {
     if (future.isFailed()) {
-      VLOG(1) << "Failed to link, connect: " << future.failure();
+      LOG(WARNING) << "Failed to link to '" << to.address
+                   << "', connect: " << future.failure();
     }
 
     // Check if SSL is enabled, and whether we allow a downgrade to
@@ -1438,7 +1439,8 @@ void SocketManager::link_connect(
 
         Try<Socket> create = Socket::create(SocketImpl::Kind::POLL);
         if (create.isError()) {
-          VLOG(1) << "Failed to link, create socket: " << create.error();
+          LOG(WARNING) << "Failed to link to '" << to.address
+                       << "', create socket: " << create.error();
           socket_manager->close(socket);
           return;
         }
@@ -1542,7 +1544,8 @@ void SocketManager::link(
         // from SSL to POLL if enabled.
         Try<Socket> create = Socket::create(kind);
         if (create.isError()) {
-          LOG(WARNING) << "Failed to link, create socket: " << create.error();
+          LOG(WARNING) << "Failed to link to '" << to.address
+                       << "', create socket: " << create.error();
 
           // Failure to create a new socket should generate an `ExitedEvent`
           // for the linkee. At this point, we have not passed ownership of
@@ -1574,7 +1577,8 @@ void SocketManager::link(
         // create a new socket anyway.
         Try<Socket> create = Socket::create(kind);
         if (create.isError()) {
-          LOG(WARNING) << "Failed to link, create socket: " << create.error();
+          LOG(WARNING) << "Failed to link to '" << to.address
+                       << "', create socket: " << create.error();
 
           // Failure to create a new socket should generate an `ExitedEvent`
           // for the linkee. At this point, we have not passed ownership of
@@ -1827,8 +1831,8 @@ void SocketManager::send_connect(
 {
   if (future.isDiscarded() || future.isFailed()) {
     if (future.isFailed()) {
-      VLOG(1) << "Failed to send '" << message.name << "' to '"
-              << message.to.address << "', connect: " << future.failure();
+      LOG(WARNING) << "Failed to send '" << message.name << "' to '"
+                   << message.to.address << "', connect: " << future.failure();
     }
 
     // Check if SSL is enabled, and whether we allow a downgrade to
@@ -1848,7 +1852,8 @@ void SocketManager::send_connect(
       synchronized (mutex) {
         Try<Socket> create = Socket::create(SocketImpl::Kind::POLL);
         if (create.isError()) {
-          VLOG(1) << "Failed to link, create socket: " << create.error();
+          LOG(WARNING) << "Failed to link to '" << message.to.address
+                       << "', create socket: " << create.error();
           socket_manager->close(socket);
           return;
         }
@@ -1943,7 +1948,9 @@ void SocketManager::send(Message&& message, const SocketImpl::Kind& kind)
       // from SSL to POLL if enabled.
       Try<Socket> create = Socket::create(kind);
       if (create.isError()) {
-        VLOG(1) << "Failed to send, create socket: " << create.error();
+        LOG(WARNING) << "Failed to send '" << message.name
+                     << "' to '" << message.to.address
+                     << "', create socket: " << create.error();
         return;
       }
       socket = create.get();