mirror of
https://github.com/google/nomulus.git
synced 2025-05-12 22:38:16 +02:00
Allow over 1000 dns-updates to be handled at once
The task-queue API only allows reading 1000 tasks at a time, hence the original reason for this limit. We get over that limit by reading (and processing) items from the queue in a loop - 1000 at a time. This is important because the 1000 dns-updates are shared among all TLDs, meaning that a TLD with >1000 waiting updates can affect the update latency of other TLDs. In addition, partially fixes the bug where if there are more than 1000 updates to paused / non-existing TLDs, we completely block all updated to all TLDs. By partially fixed, I mean "if we have around 1000 updates to paused TLDs, we will read them every time ReadDnsUpdates is called, ignore then, and only then get to the actual updates we want to process". This works for a number of 1000 updates waiting - but if paused TLDs have tens or hundreds of thousands of updates waiting - this might still choke up other TLDs (not to mention we keep reading / updating 10s or 100s of thousands of tasks in the queue, that's... bad.) A more thorough fix will come in a future CL, as it requires a more thorough change in the code. Note that the queue lease command supports a maximum of 10 QPS. Any more than that - and we get errors / empty results. Hence we limit our QPS to 9 to be on the safe side. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=185218684
This commit is contained in:
parent
ce5baafc4a
commit
bba975a991
7 changed files with 389 additions and 78 deletions
|
@ -18,6 +18,7 @@ import static com.google.appengine.tools.development.testing.LocalTaskQueueTestC
|
|||
import static com.google.common.base.Preconditions.checkState;
|
||||
import static com.google.common.base.Predicates.in;
|
||||
import static com.google.common.base.Predicates.not;
|
||||
import static com.google.common.collect.ImmutableList.toImmutableList;
|
||||
import static com.google.common.collect.Iterables.getFirst;
|
||||
import static com.google.common.collect.Multisets.containsOccurrences;
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
@ -258,6 +259,15 @@ public class TaskQueueHelper {
|
|||
}
|
||||
}
|
||||
|
||||
public static ImmutableList<ImmutableMultimap<String, String>> getQueuedParams(String queueName) {
|
||||
return getQueueInfo(queueName)
|
||||
.getTaskInfo()
|
||||
.stream()
|
||||
.map(MatchableTaskInfo::new)
|
||||
.map(taskInfo -> ImmutableMultimap.copyOf(taskInfo.params))
|
||||
.collect(toImmutableList());
|
||||
}
|
||||
|
||||
/** Empties the task queue. */
|
||||
public static void clearTaskQueue(String queueName) throws Exception {
|
||||
getLocalTaskQueue().flushQueue(queueName);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue