cloudflare / complainer

Complainer's job is to send notifications to different services when tasks fail on Mesos cluster.
MIT License
82 stars 13 forks source link

Fix an issue for Mesos tasks without statuses #7

Closed arkan closed 8 years ago

arkan commented 8 years ago

Hello there,

Thanks so much for this tool! I was willing to write something similar but you guys were faster ;-)

On my staging cluster I had some failed Mesos tasks without any statuses. It resulted in a crash.

So I came up with this patch that fixes the issues without (i hope) breaking other stuff.

Thanks!

bobrik commented 8 years ago

What Mesos version are you running? Can you show me the except from /master/state with empty statuses?

Thanks!

arkan commented 8 years ago

Sure! The cluster is based on Mesos 0.27.1. Regarding the output from /master/state here is a small excerpt on what I have on my side:

        ...
        {
          "id": "ct:1462291200000:0:task:",
          "name": "ChronosTask:task-id",
          "framework_id": "d155cdb7-671d-43e7-b203-05917e41e23e-0001",
          "executor_id": "",
          "slave_id": "d155cdb7-671d-43e7-b203-05917e41e23e-S4",
          "state": "TASK_FAILED",
          "resources": {
            "cpus": 0.1,
            "disk": 256,
            "mem": 1024
          },
          "statuses": [],
          "container": {
            "type": "DOCKER",
            "docker": {
              "image": "my-docker-image:latest",
              "network": "HOST",
              "privileged": false,
              "force_pull_image": true
            }
          }
        },
        ...

Thanks!

bobrik commented 8 years ago

👍

arkan commented 8 years ago

Thanks for the merge :metal: