Use different locks for thin and full rde reports

The lock is used to prevent dual writing of the same output file, and to
prevent us from generating the same data twice (if RdeStaging was run twice).

However, at times when we're creating both RDE and BRDA reports - we use the
same lock for both even though they write to different files and create
different reports.

This causes one of the two to almost always fail (when both are created, which
is once a week I think) delaying that report by several hours.

Note that the "prefix" part of the filenames has the mode in it, so different
modes will not have the same files.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168882007
This commit is contained in:
guyben 2017-09-15 13:45:00 -07:00 committed by jianglai
parent 892424b148
commit 3cc44259da

View file

@ -107,7 +107,7 @@ public final class RdeStagingReducer extends Reducer<PendingDeposit, DepositFrag
reduceWithLock(key, fragments);
return null;
}};
String lockName = String.format("RdeStaging %s", key.tld());
String lockName = String.format("RdeStaging %s %s", key.tld(), key.mode());
if (!lockHandler.executeWithLocks(lockRunner, null, lockTimeout, lockName)) {
logger.warningfmt("Lock in use: %s", lockName);
}