Automated g4 rollback of changelist 199643208.

*** Reason for rollback ***

We suspect that this is breaking RDE more, so we're going to rollout a cherrypick of this reversion.

*** Original change description ***

Upload to GCS before uploading to FTP

Currently we encode and upload the deposite to GCS and the FTP server at the
same time. This makes debugging harder as there are many possible points of
failure, some of which are external and some internal.

In this CL we start by encoding + uploading the deposit to GCS, and once
that's done we copy the data from GCS to the FTP server. This will (hopefully)
allow us to distinguish between errors on the FTP server and errors with the
GCS connection.

***

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201005260
This commit is contained in:
mcilwain 2018-06-18 09:12:38 -07:00 committed by Ben McIlwain
parent 4098487b80
commit 03f8090886
5 changed files with 181 additions and 43 deletions

View file

@ -87,15 +87,14 @@ class EscrowTaskRunner {
final Duration interval) {
Callable<Void> lockRunner =
() -> {
logger.atInfo().log("TLD: %s", registry.getTld());
DateTime startOfToday = clock.nowUtc().withTimeAtStartOfDay();
Cursor cursor = ofy().load().key(Cursor.createKey(cursorType, registry)).now();
logger.atInfo().log(
"TLD: %s, cursorType: %s cursor: %s", registry.getTld(), cursorType, cursor);
final DateTime nextRequiredRun = (cursor == null ? startOfToday : cursor.getCursorTime());
if (nextRequiredRun.isAfter(startOfToday)) {
throw new NoContentException("Already completed");
}
logger.atInfo().log("CursorTime: %s", nextRequiredRun);
logger.atInfo().log("Cursor: %s", nextRequiredRun);
task.runWithLock(nextRequiredRun);
ofy()
.transact(