Fix race between hydra-eval-jobs and hydra-update-gc-roots
[?]
Jul 14, 2014, 11:18 AM
3D3F5I744YILPYZYZQHGADFNYIM7RESDLSCDULH5WVIIPTYD5GYQCDependencies
- [2]
PMNWRTGJAdd multiple output support - [3]
ACFFJUANhydra-update-gc-roots: Keep more evals - [4]
WZ3AEJ67* hydra_update_gc_roots.pl registers build outputs that should be kept - [5]
FP72ASZXNo wonder our disk was filling up - [6]
IN272KZW* Automatically keep all builds in the latest successful release in - [7]
KJQWSRCCSpeed up hydra-update-gc-roots - [8]
SZPBGW2NFix a race condition in hydra-update-gc-roots - [9]
4X6NS66Q* Keep the most recent builds for each job.
Change contents
- edit in src/script/hydra-update-gc-roots at line 5
use File::stat; - replacement in src/script/hydra-update-gc-roots at line 52
# Read the current GC roots. We need to do that here so that we don't# delete roots that were added while we were determining the desired# roots.# Read the current GC roots. - edit in src/script/hydra-update-gc-roots at line 124
my $now = time(); - replacement in src/script/hydra-update-gc-roots at line 130[3.2221]→[3.2221:2267](∅→∅),[3.2267]→[2.19656:19681](∅→∅),[2.19681]→[3.0:78](∅→∅),[3.2864]→[3.0:78](∅→∅)
print STDERR "removing root $path\n";$rootsDeleted++;unlink "$gcRootsDir/$link" or warn "cannot remove $gcRootsDir/$link";# Don't delete roots that are less than a day old, to prevent# a race where hydra-eval-jobs has added a root but# hydra-evaluator hasn't added them to the database yet.if (lstat($path)->ctime < $now - 24 * 60 * 60) {print STDERR "removing root $path\n";$rootsDeleted++;unlink "$gcRootsDir/$link" or warn "cannot remove $gcRootsDir/$link";} else {print STDERR "NOT removing recent root $path\n";$rootsKept++;}