chukwa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ey...@apache.org
Subject svn commit: r760704 - in /hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection: agent/AgentControlSocketListener.java controller/ChukwaAgentController.java
Date Tue, 31 Mar 2009 22:45:44 GMT
Author: eyang
Date: Tue Mar 31 22:45:43 2009
New Revision: 760704

URL: http://svn.apache.org/viewvc?rev=760704&view=rev
Log:
CHUKWA-73. Added Socket Timeout 60 seconds.

Modified:
    hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/agent/AgentControlSocketListener.java
    hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/controller/ChukwaAgentController.java

Modified: hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/agent/AgentControlSocketListener.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/agent/AgentControlSocketListener.java?rev=760704&r1=760703&r2=760704&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/agent/AgentControlSocketListener.java
(original)
+++ hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/agent/AgentControlSocketListener.java
Tue Mar 31 22:45:43 2009
@@ -56,6 +56,12 @@
 
     ListenThread(Socket conn) {
       connection = conn;
+      try {
+        connection.setSoTimeout(60000);
+      } catch (SocketException e) {
+        log.warn("Error while settin soTimeout to 60000");
+        e.printStackTrace();
+      }
       this.setName("listen thread for " + connection.getRemoteSocketAddress());
     }
 

Modified: hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/controller/ChukwaAgentController.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/controller/ChukwaAgentController.java?rev=760704&r1=760703&r2=760704&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/controller/ChukwaAgentController.java
(original)
+++ hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/controller/ChukwaAgentController.java
Tue Mar 31 22:45:43 2009
@@ -26,6 +26,7 @@
 import java.io.OutputStreamWriter;
 import java.io.PrintWriter;
 import java.net.Socket;
+import java.net.SocketException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
@@ -120,6 +121,12 @@
      */
     long register() throws IOException {
       Socket s = new Socket(hostname, portno);
+      try {
+        s.setSoTimeout(60000);
+      } catch (SocketException e) {
+        log.warn("Error while settin soTimeout to 60000");
+        e.printStackTrace();
+      }
       PrintWriter bw = new PrintWriter(new OutputStreamWriter(s
           .getOutputStream()));
       bw.println("ADD " + name + " " + appType + " " + params + " " + offset);
@@ -142,6 +149,12 @@
 
     void unregister() throws IOException {
       Socket s = new Socket(hostname, portno);
+      try {
+        s.setSoTimeout(60000);
+      } catch (SocketException e) {
+        log.warn("Error while settin soTimeout to 60000");
+        e.printStackTrace();
+      }
       PrintWriter bw = new PrintWriter(new OutputStreamWriter(s
           .getOutputStream()));
       bw.println("SHUTDOWN " + id);
@@ -310,6 +323,12 @@
 
   Map<Long, ChukwaAgentController.Adaptor> list() throws IOException {
     Socket s = new Socket(hostname, portno);
+    try {
+      s.setSoTimeout(60000);
+    } catch (SocketException e) {
+      log.warn("Error while settin soTimeout to 60000");
+      e.printStackTrace();
+    }
     PrintWriter bw = new PrintWriter(
         new OutputStreamWriter(s.getOutputStream()));
 



Mime
View raw message