Share via


Cluster.CancelJob Method

Cancels the specified job.

Namespace: Microsoft.ComputeCluster
Assembly: CcpAPI (in ccpapi.dll)

Usage

Syntax

'Declaration
Public Sub CancelJob ( _
    jobId As Integer, _
    message As String _
)
public void CancelJob (
    int jobId,
    string message
)
public:
virtual void CancelJob (
    int jobId, 
    String^ message
) sealed
public final void CancelJob (
    int jobId, 
    String message
)
public final function CancelJob (
    jobId : int, 
    message : String
)

Parameters

  • jobId
    The job identifier. The Cluster.AddJob method returns this value. If you have a job object that has already been added to the cluster, you can access the Job.Id property to get the identifier.
  • message
    A message that describes the reason why the job was canceled. The message is limited to 320 Unicode characters. Can be empty.

    The message is stored with the job. To get the message, access the Job.ErrorMessage property.

Remarks

The job is removed from the queue but remains in the cluster until the value of the TTLCompletedJobs cluster configuration parameter is exceeded. For a description of this parameter, see the Cluster.SetClusterParameter method.

To cancel a job, the job's status must be: not submitted, queued, or running. If the job is running tasks when the job is canceled, the tasks are terminated and marked as failed. If you queue the job again, the tasks that were finished when the job was canceled stay finished, but all other tasks are queued (including those that failed).

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Microsoft Windows Compute Cluster Server 2003, Windows Server 2003, Windows XP

Target Platforms

Microsoft Windows Compute Cluster Server 2003, Windows Server 2003 with Compute Cluster Pack Client Utilities, Windows XP with Compute Cluster Pack Client Utilities

See Also

Reference

Cluster Class
Cluster Members
Microsoft.ComputeCluster Namespace
Cluster.AddJob Method
CancelJobs
CancelTask