Example #1
0
    def test_failed_to_cancel_job(self, time_get, cluster_get, job_exec_get, job_get, job_execution_update_get):
        info = {"status": edp.JOB_STATUS_RUNNING}

        job, job_exec = u.create_job_exec(edp.JOB_TYPE_PIG, None, False, info)
        job_exec_get.return_value = job_exec
        job_get.return_value = job

        cluster = u.create_cluster()
        cluster.status = c_u.CLUSTER_STATUS_ACTIVE
        cluster_get.return_value = cluster

        time_get.return_value = 10000

        job_execution_update_get.return_value = job_exec

        with testtools.ExpectedException(ex.CancelingFailed):
            job_manager.cancel_job(job_exec.id)
Example #2
0
    def test_failed_to_cancel_job(self, time_get, cluster_get, job_exec_get,
                                  job_get, job_execution_update_get):
        info = {'status': edp.JOB_STATUS_RUNNING}

        job, job_exec = u.create_job_exec(edp.JOB_TYPE_PIG, None, False, info)
        job_exec_get.return_value = job_exec
        job_get.return_value = job

        cluster = u.create_cluster()
        cluster.status = c_u.CLUSTER_STATUS_ACTIVE
        cluster_get.return_value = cluster

        time_get.return_value = 10000

        job_execution_update_get.return_value = job_exec

        with testtools.ExpectedException(ex.CancelingFailed):
            job_manager.cancel_job(job_exec.id)
Example #3
0
def _delete_job_execution(job_execution_id):
    try:
        job_execution = job_manager.cancel_job(job_execution_id)
        if not job_execution:
            # job_execution was deleted already, nothing to do
            return
    except exceptions.CancelingFailed:
        LOG.error("Job execution can't be cancelled in time. "
                  "Deleting it anyway.")
    conductor.job_execution_destroy(context.ctx(), job_execution_id)
Example #4
0
def _delete_job_execution(job_execution_id):
    try:
        job_execution = job_manager.cancel_job(job_execution_id)
        if not job_execution:
            # job_execution was deleted already, nothing to do
            return
    except exceptions.CancelingFailed:
        LOG.error("Job execution can't be cancelled in time. "
                  "Deleting it anyway.")
    conductor.job_execution_destroy(context.ctx(), job_execution_id)
Example #5
0
def _cancel_job_execution(job_execution_id):
    job_manager.cancel_job(job_execution_id)
Example #6
0
def _cancel_job_execution(job_execution_id):
    job_manager.cancel_job(job_execution_id)
Example #7
0
def cancel_job_execution(id):
    return manager.cancel_job(id)
Example #8
0
File: api.py Project: viplav/sahara
def cancel_job_execution(id):
    return manager.cancel_job(id)