I am trying to run a task and it seems to never reach its end, getting stuck. I would usually suspect an infinite loop, but there is no loop this time. This code is running