Since it read the actual roots after determining the set of desired roots, there was a possibility that it would delete roots added by hydra-evaluator or hydra-build while hydra-update-gc-roots was running. This could cause a derivation to be garbage-collected before the build was performed, for instance. Now the actual roots are read first, so any root added after that time is not deleted.
SZPBGW2NVHOOW4E3VIB2B35V7YRF67DFVVGUK573LVD574IHSA6AC
# 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.
print STDERR "*** reading current roots...\n";
my $gcRootsDir = getGCRootsDir;
opendir DIR, $gcRootsDir or die;
my @roots = readdir DIR;
closedir DIR;