Add more RDE upload informational logging

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=198587342
This commit is contained in:
mcilwain 2018-05-30 11:03:54 -07:00 committed by Ben McIlwain
parent 70b13596e4
commit 593dcc3000

View file

@ -124,14 +124,15 @@ public final class RdeUploadAction implements Runnable, EscrowTask {
@Override @Override
public void run() { public void run() {
logger.atInfo().log("Attempting to acquire RDE upload lock for TLD '%s'.", tld);
runner.lockRunAndRollForward(this, Registry.get(tld), timeout, CursorType.RDE_UPLOAD, interval); runner.lockRunAndRollForward(this, Registry.get(tld), timeout, CursorType.RDE_UPLOAD, interval);
taskQueueUtils.enqueue( taskQueueUtils.enqueue(
reportQueue, reportQueue, withUrl(RdeReportAction.PATH).param(RequestParameters.PARAM_TLD, tld));
withUrl(RdeReportAction.PATH).param(RequestParameters.PARAM_TLD, tld));
} }
@Override @Override
public void runWithLock(final DateTime watermark) throws Exception { public void runWithLock(final DateTime watermark) throws Exception {
logger.atInfo().log("Verifying readiness to upload the RDE deposit.");
DateTime stagingCursorTime = getCursorTimeOrStartOfTime( DateTime stagingCursorTime = getCursorTimeOrStartOfTime(
ofy().load().key(Cursor.createKey(CursorType.RDE_STAGING, Registry.get(tld))).now()); ofy().load().key(Cursor.createKey(CursorType.RDE_STAGING, Registry.get(tld))).now());
if (!stagingCursorTime.isAfter(watermark)) { if (!stagingCursorTime.isAfter(watermark)) {
@ -155,6 +156,7 @@ public final class RdeUploadAction implements Runnable, EscrowTask {
verifyFileExists(xmlFilename); verifyFileExists(xmlFilename);
verifyFileExists(xmlLengthFilename); verifyFileExists(xmlLengthFilename);
verifyFileExists(reportFilename); verifyFileExists(reportFilename);
logger.atInfo().log("Commencing RDE upload for TLD '%s' to '%s'.", tld, uploadUrl);
final long xmlLength = readXmlLength(xmlLengthFilename); final long xmlLength = readXmlLength(xmlLengthFilename);
retrier.callWithRetry( retrier.callWithRetry(
() -> { () -> {
@ -162,6 +164,8 @@ public final class RdeUploadAction implements Runnable, EscrowTask {
return null; return null;
}, },
JSchException.class); JSchException.class);
logger.atInfo().log(
"Updating RDE cursor '%s' for TLD '%s' following successful upload.", RDE_UPLOAD_SFTP, tld);
ofy() ofy()
.transact( .transact(
() -> () ->
@ -200,7 +204,7 @@ public final class RdeUploadAction implements Runnable, EscrowTask {
@VisibleForTesting @VisibleForTesting
protected void upload( protected void upload(
GcsFilename xmlFile, long xmlLength, DateTime watermark, String name) throws Exception { GcsFilename xmlFile, long xmlLength, DateTime watermark, String name) throws Exception {
logger.atInfo().log("Uploading %s to %s", xmlFile, uploadUrl); logger.atInfo().log("Uploading XML file '%s' to remote path '%s'.", xmlFile, uploadUrl);
try (InputStream gcsInput = gcsUtils.openInputStream(xmlFile); try (InputStream gcsInput = gcsUtils.openInputStream(xmlFile);
Ghostryde.Decryptor decryptor = ghostryde.openDecryptor(gcsInput, stagingDecryptionKey); Ghostryde.Decryptor decryptor = ghostryde.openDecryptor(gcsInput, stagingDecryptionKey);
Ghostryde.Decompressor decompressor = ghostryde.openDecompressor(decryptor); Ghostryde.Decompressor decompressor = ghostryde.openDecompressor(decryptor);