Batch task restarts automatically RRS feed

  • Question

  • Am using Batch Service from Azure. And am uploading the batch output to azure blob. The file name uploaded has the vm's ip and timestamp at which my code is creating a class object, which will be created only once. But, when i observed the final output, i have more than one file from a specific VM, with a different timestamp.

    Do anyone has come across with the same problem and figured out a solution.

    Kindly help.

    Monday, May 29, 2017 1:26 PM

All replies

  • Hi Oliver,

    It's possible that something happened to the VM the task was running on originally, which caused the task to be requeued and run on a different VM, or even the same VM at a different time. If you have retries configured, it could be that your task exited with a nonzero exit code and then retried and succeeded on a subsequent run.

    If this is for data output you have a few options:

    1) You can check out using the new OutputFiles feature to do the upload for you (if you're not using this already). You can read more about it here: https://docs.microsoft.com/en-us/rest/api/batchservice/batch-service-rest-api-versioning (see the section about OutputFiles). If you want more details on this let me know as we just released this feature not all of the documentation is available yet.

    2) Are you uploading data from a task? If so, does it make sense to use the task name rather than the machine IP and a timestamp?

    3) If you really want to use the IP/timestamp, maybe the task should make itself resilient to restarts by first checking the target container and deleting other files with the same IP before uploading a new file?

    Hope some of the above helps.


    Wednesday, May 31, 2017 1:42 AM