Browse Source

HADOOP-1213. Improve logging of errors by IPC server.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@527694 13f79535-47bb-0310-9956-ffa450edef68
Doug Cutting 18 years ago
parent
commit
07d9ed0d76
2 changed files with 7 additions and 4 deletions
  1. 3 0
      CHANGES.txt
  2. 4 4
      src/java/org/apache/hadoop/ipc/Server.java

+ 3 - 0
CHANGES.txt

@@ -173,6 +173,9 @@ Trunk (unreleased changes)
     deprecate InputFormatBase.  Also make LineRecordReader easier to
     deprecate InputFormatBase.  Also make LineRecordReader easier to
     extend.  (Runping Qi via cutting)
     extend.  (Runping Qi via cutting)
 
 
+53. HADOOP-1213.  Improve logging of errors by IPC server, to
+    consistently include the service name and the call.  (cutting)
+
 
 
 Release 0.12.3 - 2007-04-06
 Release 0.12.3 - 2007-04-06
 
 

+ 4 - 4
src/java/org/apache/hadoop/ipc/Server.java

@@ -554,8 +554,8 @@ public abstract class Server {
           if (System.currentTimeMillis() - call.receivedTime > 
           if (System.currentTimeMillis() - call.receivedTime > 
               maxCallStartAge) {
               maxCallStartAge) {
             ReflectionUtils.logThreadInfo(LOG, "Discarding call " + call, 30);
             ReflectionUtils.logThreadInfo(LOG, "Discarding call " + call, 30);
-            LOG.warn("Call " + call.toString() + 
-                     " discarded for being too old (" +
+            LOG.warn(getName()+", call "+call
+                     +": discarded for being too old (" +
                      (System.currentTimeMillis() - call.receivedTime) + ")");
                      (System.currentTimeMillis() - call.receivedTime) + ")");
             continue;
             continue;
           }
           }
@@ -572,7 +572,7 @@ public abstract class Server {
           try {
           try {
             value = call(call.param);             // make the call
             value = call(call.param);             // make the call
           } catch (Throwable e) {
           } catch (Throwable e) {
-            LOG.info(getName() + " call error: " + e, e);
+            LOG.info(getName()+", call "+call+": error: " + e, e);
             errorClass = e.getClass().getName();
             errorClass = e.getClass().getName();
             error = StringUtils.stringifyException(e);
             error = StringUtils.stringifyException(e);
           }
           }
@@ -591,7 +591,7 @@ public abstract class Server {
               }
               }
               out.flush();
               out.flush();
             } catch (Exception e) {
             } catch (Exception e) {
-              LOG.warn("handler output error", e);
+              LOG.warn(getName()+", call "+call+": output error", e);
               synchronized (connectionList) {
               synchronized (connectionList) {
                 if (connectionList.remove(call.connection))
                 if (connectionList.remove(call.connection))
                   numConnections--;
                   numConnections--;