You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2011/06/05 05:20:57 UTC

svn commit: r1131547 - in /incubator/mesos/trunk: frameworks/hadoop-0.20.0/src/mapred/org/apache/hadoop/mapred/NexusExecutor.java frameworks/hadoop-0.20.0/src/mapred/org/apache/hadoop/mapred/NexusScheduler.java src/slave.cpp

Author: benh
Date: Sun Jun  5 03:20:57 2011
New Revision: 1131547

URL: http://svn.apache.org/viewvc?rev=1131547&view=rev
Log:
Fixed a bug introduced in API refactoring whereby framework messages
were no longer automatically having their slaveID set by the slave. This
was causing a crash in Hadoop (GH-16).

Modified:
    incubator/mesos/trunk/frameworks/hadoop-0.20.0/src/mapred/org/apache/hadoop/mapred/NexusExecutor.java
    incubator/mesos/trunk/frameworks/hadoop-0.20.0/src/mapred/org/apache/hadoop/mapred/NexusScheduler.java
    incubator/mesos/trunk/src/slave.cpp

Modified: incubator/mesos/trunk/frameworks/hadoop-0.20.0/src/mapred/org/apache/hadoop/mapred/NexusExecutor.java
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/frameworks/hadoop-0.20.0/src/mapred/org/apache/hadoop/mapred/NexusExecutor.java?rev=1131547&r1=1131546&r2=1131547&view=diff
==============================================================================
--- incubator/mesos/trunk/frameworks/hadoop-0.20.0/src/mapred/org/apache/hadoop/mapred/NexusExecutor.java (original)
+++ incubator/mesos/trunk/frameworks/hadoop-0.20.0/src/mapred/org/apache/hadoop/mapred/NexusExecutor.java Sun Jun  5 03:20:57 2011
@@ -32,6 +32,8 @@ public class NexusExecutor extends Execu
 
   private JobConf conf;
   private TaskTracker taskTracker;
+
+  private int slaveId;
   
   private AtomicInteger nextRpcId = new AtomicInteger();
   
@@ -69,6 +71,7 @@ public class NexusExecutor extends Execu
   @Override
   public void init(ExecutorArgs args) {
     try {
+      slaveId = args.getSlaveId();
       conf = new JobConf();
       conf.set("mapred.job.tracker", new String(args.getData()));
       taskTracker = new TaskTracker(conf, this);
@@ -160,6 +163,8 @@ public class NexusExecutor extends Execu
       DataInputStream in = new DataInputStream(
           new ByteArrayInputStream(message.getData()));
       int rpcId = in.readInt();
+      //LOG.info("Executor on " + slaveId + " got RPC response for ID " + 
+      //         rpcId + " with length " + message.getData().length);
       writable.readFields(in);
       RpcResponse response = rpcResponses.get(rpcId);
       synchronized(response) {
@@ -189,10 +194,10 @@ public class NexusExecutor extends Execu
   }
 
   private Object invokeRPC(String method, Object... args) throws IOException {
-    //LOG.info("Making RPC: " + method);
-    
     // Get a unique RPC ID for this call
     int rpcId = nextRpcId.getAndIncrement();
+    //LOG.info("Executor on " + slaveId + " making RPC: " + method + 
+    //         " with ID " + rpcId);
     
     // Create an RpcResponse for this call
     RpcResponse response = new RpcResponse(rpcId);

Modified: incubator/mesos/trunk/frameworks/hadoop-0.20.0/src/mapred/org/apache/hadoop/mapred/NexusScheduler.java
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/frameworks/hadoop-0.20.0/src/mapred/org/apache/hadoop/mapred/NexusScheduler.java?rev=1131547&r1=1131546&r2=1131547&view=diff
==============================================================================
--- incubator/mesos/trunk/frameworks/hadoop-0.20.0/src/mapred/org/apache/hadoop/mapred/NexusScheduler.java (original)
+++ incubator/mesos/trunk/frameworks/hadoop-0.20.0/src/mapred/org/apache/hadoop/mapred/NexusScheduler.java Sun Jun  5 03:20:57 2011
@@ -313,7 +313,7 @@ class NexusScheduler extends nexus.Sched
       //LOG.info("In handleRPC, message length = " + data.length);
       int rpcId = in.readInt();
       String method = in.readUTF();
-      //LOG.info("Responding to " + method + " RPC!");
+      //LOG.info("Responding to " + method + " from executor on " + slaveId);
       int numArgs = in.readInt();
       Object[] args = new Object[numArgs];
       for (int i = 0; i < numArgs; i++) {

Modified: incubator/mesos/trunk/src/slave.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/slave.cpp?rev=1131547&r1=1131546&r2=1131547&view=diff
==============================================================================
--- incubator/mesos/trunk/src/slave.cpp (original)
+++ incubator/mesos/trunk/src/slave.cpp Sun Jun  5 03:20:57 2011
@@ -344,6 +344,8 @@ void Slave::operator () ()
 
       case E2S_FRAMEWORK_MESSAGE: {
         unpack<E2S_FRAMEWORK_MESSAGE>(fid, message);
+        // Set slave ID in case framework omitted it
+        message.slaveId = this->id;
         send(master, pack<S2M_FRAMEWORK_MESSAGE>(id, fid, message));
         break;
       }