EVG-5977 moved updating builds and versions to a job, because this code would often take a minute to run, which would cause agents to exit, because their MarkEnd requests would time out.
However, moving it to a job may have been the cause of queueing in the database, which increased request latency and caused errors in the system. We therefore reverted that commit. I suspect that the queueing happens because marking a job ended requires many queries.
John Liu suggested that persisting the blocked state of task would eliminate a large amount of these queries. This ticket is to do that or determine another way to improve the job.