Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-10178

Job cancel REST API not working

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Invalid
    • Affects Version/s: 1.5.1, 1.5.2, 1.6.0
    • Fix Version/s: None
    • Component/s: Runtime / REST
    • Labels:
      None
    • Environment:

      Running as a Docker container using the default flink Docker images.

      Description

      I've been trying to work with the Flink REST API to cancel a running job. 

      When I deploy a simple job I can retrieve the Job information using the jobs/overview endpoint which returns:

      {
        "jobs": [
          {
            "jid": "f907f847451cfd9231b7d3c0662b149b",
            "name": "Windowed WordCount",
            "state": "RUNNING",
            "start-time": 1534770489437,
            "end-time": -1,
            "duration": 72682,
            "last-modification": 1534770489942,
            "tasks": {
              "total": 6,
              "created": 0,
              "scheduled": 0,
              "deploying": 0,
              "running": 6,
              "finished": 0,
              "canceling": 0,
              "canceled": 0,
              "failed": 0,
              "reconciling": 0
            }
          }
        ]
      }
      

      I can also request more information about the job using the jobs/f907f847451cfd9231b7d3c0662b149b endpoint.

      According to the documentation, I should be able to do a DELETE request to jobs/f907f847451cfd9231b7d3c0662b149b/cancel. Doing so returns a 404 with the following body:

      {"errors":["Not found."]}

      I also tried a GET request to jobs/f907f847451cfd9231b7d3c0662b149b/cancel-with-savepoint/. That simply returns a 404 without a body.

      I tried it with Flink 1.5.1, 1.5.2 and 1.6.0 and get consistent results.

      I looked at which API is being used by the Flink web UI when pressing the 'Cancel' button and that one seems to go to jobs/f907f847451cfd9231b7d3c0662b149b/yarn-cancel. If I do a GET request to that one manually it does actually cancel the job.

      I've been looking into the Flink source code but couldn't find an immediate clue to what's going on. 

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mrooding Marc Rooding
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: