Does TeamCity auto delete old checkout directories?
Does TeamCity 8.1 auto delete old checkout directories? We have many build machines and branches. Some of the branches are very large (couple hundred GB). I try to keep even rarely used branches synced on the builders in case we suddenly need to build from that branch.
Lately I've noticed that some of the build machines seem to be missing branches that I'm sure were synced there in the past. We even have a couple machines that were dedicated to a single branch, but haven't been needed in a few weeks. I looked at them today and their work directories are completely empty, except for the .old folder and directory.map file.
I've searched the settings and docs but cannot find any mention of this. Does anybody know what's going on here?
Please sign in to leave a comment.
In "Automatic Checkout Directory Cleaning" on Build Checkout Directory is described when the checkout directory will be deleted.
Thank you. That has been helpful.
Before I mark this thread as answered, I'm hoping to get a bit more info on how this mechanism is implemented.
From my testing, I've inferred the following: The expiration time for a particular checkout directory of a particular agent is only propogated when a build is run on that particular agent using that particular checkout directory.
For example:
The important note here as that simply setting the expiration time globally will not actually change the expiration time for any checkout directories unless they get used again. So if your goal is to prevent old checkout directories from being deleted from all your agents, you must both set the expiration time to "never" and use every single checkout directory again on every single agent to propogate the new expiration time.
Have I inferred the behavior correctly?
If so, is there any way to prevent deletion without re-using every single checkout directory on every single agent?
Hi Matthew,
Now it works exactly as you described. So for now the solution is to restart all build on all agents (to check the current value you can use buildAgent/work/directory.map file, but it is not recommended to modify it).
We've created the issue to change this behavior - https://youtrack.jetbrains.com/issue/TW-39977. After fix: if you set teamcity.agent.build.checkoutDir.expireHours for agent, then default value will be written to the directory.map file for all checkoutDirs. Default value will be equal to the current value of teamcity.agent.build.checkoutDir.expireHours option (instead of 8 days as it is now).
Thank you for clearing that up.
I have some thoughts on the proposed solution. I'll add them to the tracker.