Trying to understand "optimized to already started build"
I need some more information around what's happening in a situation we encountered.
I have a user who has a regularly scheduled nightly build for 23:00 of a build we'll call Build A. Build A was triggered by the scheduled trigger yesterday evening at 23:00 and then "optimized" out of the queue by TeamCity ("comment: optimized to already started build.") about 12 seconds after being queued.
Multiple other builds have Build A as a dependency and also get triggered on schedule around that time. These other builds use the "last known successful" setting.
When I tried to track down the issue and found info about Build A in the teamcity-server logs, and followed its build id # via the rest api <teamcityurl>/guestAuth/app/rest/builds/id:<build a id> in the xml a different run (we'll call this Build A run B) was being referenced. Build A run B was run the night before as part of the nightly schedule.
How do we ensure this nightly scheduled build (Build A) gets run every night and not "optimized" out? I'm not sure if this is a bug or not?
Happy to answer any questions you have about this, thanks,
James
Please sign in to leave a comment.
Hi James,
optimization is explained here, you might want to check it out: https://confluence.jetbrains.com/display/TCD10/Build+Queue
Optimized usually means that there is another instance of the configuration A (in your situation) in the queue that matches some of those conditions.
As mentioned below, in the 2017.1 release there were added options to control this behavior, so you might want to check that out.