hashicorp / levant

An open source templating and deployment tool for HashiCorp Nomad jobs
Mozilla Public License 2.0
827 stars 125 forks source link

[bug] Levant incorrectly marks deployment as failed if dead:complete #224

Open jrasell opened 6 years ago

jrasell commented 6 years ago

Description

During batch job deployments with multiple tasks in a group that finish quickly and using the force-batch flag Levant incorrectly exits with status 1. This is because the job status checker is only looking for the is taking the job status = dead to mean failed; whereas this can coincide with client status complete indicating the job finished successfully.

publysher commented 5 years ago

This can also happen without force-batch and having tasks in multiple groups.

Example:

job "test" {
  datacenters = ["..."]

  type = "batch"

  group "quick" {
    task "quick" {
      driver = "exec"
      config {
        command = "sleep"
        args = ["1"]
      }
      resources = {
        cpu    = 100
        memory = 50
      }
    }
  }

  group "slow" {
    task "slow" {
      driver = "exec"
      config {
        command = "sleep"
        args = ["120"]
      }
      resources = {
        cpu    = 100
        memory = 50
      }
    }
  }
}