When you submit an SQL, Spark, or MapReduce job in MaxCompute, MaxCompute instantiates the job as a task instance. A task instance tracks the full lifecycle of the job — from running to termination — including the instance ID, start time, end time, running status, and logs.
Lifecycle
A task instance moves through two stages: Running and Terminated.
-
After you submit a job, MaxCompute creates a task instance, assigns it an instance ID, and sets the instance to the Running state.
-
When the job finishes, the instance transitions to the Terminated stage. The terminal state reflects the outcome:
| State | Description |
|---|---|
| Success | The job completed without errors. |
| Failed | The job encountered an error and did not complete. |
| Cancelled | The job was stopped manually using the kill command. |
Manage instances
Use the instance ID to query status, view logs, or stop a running instance.
-- Query the status of an instance
status <instance_id>;
-- View the operation logs of an instance
wait <instance_id>;
-- Stop a running instance (status changes to Cancelled)
kill <instance_id>;
Replace <instance_id> with the actual instance ID assigned by MaxCompute.
After runningkill, runstatus <instance_id>to confirm the instance status has changed toCancelled.
Next steps
For the full list of instance operations, see Resource operations.