Batch NORDN pull queue task deletions

They were failing because the maximum App Engine task batch size is 1,000, and
we currently have more than 4,000 tasks in the pull queue. We keep re-uploading
those to NORDN because we're unable to delete the tasks after successful upload,
so the leases expire and they get processed again.

Also renames TaskEnqueuer to TaskQueueUtils to reflect its newly expanded role.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=197060903
This commit is contained in:
mcilwain 2018-05-17 15:22:34 -07:00 committed by jianglai
parent 1248a7722b
commit c989911526
21 changed files with 129 additions and 73 deletions

View file

@ -34,7 +34,7 @@ import google.registry.request.Parameter;
import google.registry.request.auth.Auth;
import google.registry.security.XsrfTokenManager;
import google.registry.util.FormattingLogger;
import google.registry.util.TaskEnqueuer;
import google.registry.util.TaskQueueUtils;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
@ -147,8 +147,7 @@ public class LoadTestAction implements Runnable {
@Parameter("hostInfos")
int hostInfosPerSecond;
@Inject
TaskEnqueuer taskEnqueuer;
@Inject TaskQueueUtils taskQueueUtils;
private final String xmlContactCreateTmpl;
private final String xmlContactCreateFail;
@ -344,7 +343,7 @@ public class LoadTestAction implements Runnable {
List<List<TaskOptions>> chunks = partition(tasks, maxTasksPerAdd());
// Farm out tasks to multiple queues to work around queue qps quotas.
for (int i = 0; i < chunks.size(); i++) {
taskEnqueuer.enqueue(getQueue("load" + (i % NUM_QUEUES)), chunks.get(i));
taskQueueUtils.enqueue(getQueue("load" + (i % NUM_QUEUES)), chunks.get(i));
}
}
}