Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError in SchedulerProcess._local_lost #24

Open
anthonyrisinger opened this issue May 19, 2015 · 1 comment
Open

AttributeError in SchedulerProcess._local_lost #24

anthonyrisinger opened this issue May 19, 2015 · 1 comment

Comments

@anthonyrisinger
Copy link

Traceback (most recent call last):
  File "/lib/python2.7/site-packages/tornado/ioloop.py", line 568, in _run_callback
    ret = callback()
  File "/lib/python2.7/site-packages/tornado/stack_context.py", line 275, in null_wrapper
    return fn(*args, **kwargs)
  File "/lib/python2.7/site-packages/pesos/scheduler.py", line 304, in launch_tasks
    self._local_lost(task, 'Malformed: A task must have either an executor or command')
  File "/lib/python2.7/site-packages/pesos/scheduler.py", line 279, in _local_lost
    update = mesos_pb2.StatusUpdate(
AttributeError: 'module' object has no attribute 'StatusUpdate'

partial fix...?

diff --git a/pesos/scheduler.py b/pesos/scheduler.py
index 9a0eba1..c7b184a 100644
--- a/pesos/scheduler.py
+++ b/pesos/scheduler.py
@@ -6,6 +6,7 @@ import threading
 import time
 import socket
 import sys
+import uuid

 from .detector import MasterDetector
 from .util import camel_call, timed, unique_suffix
@@ -276,14 +277,14 @@ class SchedulerProcess(ProtobufProcess):
     self.send(self.master, message)

   def _local_lost(self, task, reason):
-    update = mesos_pb2.StatusUpdate(
+    update = internal.StatusUpdate(
         framework_id=self.framework.id,
-        status=mesos.TaskStatus(
-            task_id=task.id,
-            state=mesos.TASK_LOST,
+        timestamp=self.clock.time(),
+        uuid=uuid.uuid4().get_bytes(),
+        status=mesos_pb2.TaskStatus(
+            task_id=task.task_id,
+            state=mesos_pb2.TASK_LOST,
             message=reason,
-            timestamp=now,
-            uuid=uuid.uuid4().get_bytes(),
         )
     )
     self.send(self.pid, update)

no pull req because i haven't tested much (really at all) and i'm short on time; just wanted to document something the popped up in my travels.

@tarnfeld
Copy link
Contributor

Sounds like a sane diff 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants