mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 08:27:14 +02:00
Use locking on async mapreduces
This ensures that only one will run at a time, which should help fix the clogged up mapreduces we've seen on sandbox. In order to do this, the UnlockerOutput is introduced. This unlocks the given Lock after all reducer shards have finished. Also increases the lease duration of the DNS refresh action from 20 to 240 minutes. 20 minutes isn't long enough; when there's a lot of domains and decent system load the mapreduce could take longer than that in the ordinary case. TESTED=Deployed to alpha and verified that more than one copy of the mapreduce wouldn't run simultaneously, and also that the lock is released when the mapreduce is finished. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=205887554
This commit is contained in:
parent
0cdbf71daf
commit
ded40851d3
11 changed files with 360 additions and 89 deletions
|
@ -45,6 +45,7 @@ import google.registry.model.domain.DesignatedContact.Type;
|
|||
import google.registry.model.domain.launch.LaunchNotice;
|
||||
import google.registry.model.domain.secdns.DelegationSignerData;
|
||||
import google.registry.model.host.HostResource;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
|
@ -165,12 +166,11 @@ public abstract class DomainBase extends EppResource {
|
|||
|
||||
/** Returns all referenced contacts from this domain or application. */
|
||||
public ImmutableSet<Key<ContactResource>> getReferencedContacts() {
|
||||
ImmutableSet.Builder<Key<ContactResource>> contactsBuilder =
|
||||
new ImmutableSet.Builder<>();
|
||||
for (DesignatedContact designated : nullToEmptyImmutableCopy(allContacts)) {
|
||||
contactsBuilder.add(designated.getContactKey());
|
||||
}
|
||||
return contactsBuilder.build();
|
||||
return nullToEmptyImmutableCopy(allContacts)
|
||||
.stream()
|
||||
.map(DesignatedContact::getContactKey)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(toImmutableSet());
|
||||
}
|
||||
|
||||
public String getTld() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue