0

I am using ACI to run a single-shot container that reads a storage blob, computes for anything from a few seconds to a few hours depending on the blob contents, then writes results to another storage blob. Containers are spawned as needed using node.js, and I periodically check for terminated containers to retrieve their exit codes, after which I delete them.

This normally works fine, but sometimes, when the computation completes very quickly and the container exits normally, Azure appears to delete the container on its own. This means that I cannot retrieve the exit code, which is inconvenient. The container is really gone, and appears neither in the list returned by the Javascript ContainerGroups.listByResourceGroup function nor in the output of the Azure cli "az container list" command.

Is this a known problem, and if so, is there a workaround? I guess I could just have my container sleep for a while before starting its computation, but without understanding the cause of the problem, I don't know how long to sleep for.

Richard Hussong
  • 123
  • 1
  • 5
  • Do you check if there a policy to remove the resources no longer use? – Charles Xu May 11 '21 at 02:34
  • @CharlesXu - I have not set such a policy, and most of my containers are not removed by Azure after they run. If such a policy were in effect, I would expect all my containers to be removed after they exited. – Richard Hussong May 27 '21 at 23:04

0 Answers0