When a job is disabled, the DisableJobOption.Wait parameter is documented incorrectly.

Nore Gabbidon 20 Reputation points
2025-07-25T11:50:40.1533333+00:00

With the option of disabling a job there are three options in the DisableJobOption enum:

  1. requeue
  2. terminate
  3. wait

The 'wait' option specifies the following in the documentation and SDK:

  • Allow currently running Tasks to complete.

I determined this to mean that all currently running tasks will complete, but any active tasks that were not running will remain, and the job will be disabled. This is NOT the case, instead ALL tasks within the Job at the time the job was marked as disabled will eventually complete, so the job will not disable until all tasks are completed.

This is highly misleading and has lead to issues with my approach. I was relying on the ability to be able to pause a job and restart it. However, I'm pretty sure now this is not the case. I think the documentation needs to be amended to make it clearer.

If there is a way to be able to pause and resume a job then any advice would be welcome.

Azure Batch
Azure Batch
An Azure service that provides cloud-scale job scheduling and compute management.
{count} votes

Accepted answer
  1. Durga Reshma Malthi 9,355 Reputation points Microsoft External Staff Moderator
    2025-07-25T12:42:46.1666667+00:00

    Hi Nore Gabbidon

    As per this document - https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.batch.common.disablejoboption?view=azure-dotnet

    • requeue: This option typically allows the job to be requeued for execution later, effectively canceling the current execution and placing it back in the queue.
    • terminate: This option immediately stops the job and all associated tasks, regardless of their current state.
    • wait: As you noted, this option allows currently running tasks to complete. However, it appears that the job will not be marked as disabled until all tasks (including those that are queued or pending) have completed.

    You are right, it would be beneficial for the documentation to clarify this point.

    If your goal is to pause and resume a job, the current behavior of the wait option may not meet your needs.

    Hope this helps!

    Please Let me know if you have any queries.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.