Uploaded image for project: 'Marathon'
  1. Marathon
  2. MARATHON-3747

"v1/tasks/kill" returns 200 even in failure

    Details

    • Type: Task
    • Status: Resolved
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 0.9.0
    • Component/s: None

      Description

      If Marathon receives a request to kill or kill & scale a task, the endpoint always returns a 200 response code even if the requested task or app does not exist.
      1. Passing nothing at all returns a 200. A 404 is more appropriate:

         $ http POST localhost:8080/v1/tasks/kill?appId=id=
         
         HTTP/1.1 200 OK
         Content-Type: application/json
         Server: Jetty(8.y.z-SNAPSHOT)
         Transfer-Encoding: chunked
         
         []
         

      2. Passing a valid appId but an invalid id (task ID) returns a 200, but a 404 or a 410 is more appropriate.

      Case 2. is particularly problematic because the app is scaled only if there is actually a task to kill. If you request the list of tasks to find a task ID, the task is somehow killed or dies, and then you request "v1/tasks/kill" for that task with scale=true, you will think you have scaled down your app since 200 is the only response right now, but Marathon will have actually silently done nothing.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              GitHub_ssorallen Ross Allen (Inactive)
              Team:
              Orchestration Team
              Watchers:
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: