1
0
mirror of https://github.com/google/nomulus synced 2026-02-16 09:59:07 +00:00

Compare commits

..

2 Commits

Author SHA1 Message Date
Juan Celhay
bca05f3982 Set heap size flags in nomulus start script (#2956)
* Set heap size flags in nomulus start script

* Add comment for flags
2026-02-13 21:16:57 +00:00
Ben McIlwain
763630bca5 Fix bug in updating registrar display name canonicalization (#2957)
We have a restriction in our system that registrar display names be unique (as
the display name is how registrars are queried through RDAP). And, the
uniqueness constraint is enforced on the canonicalized version of the display
name (with spaces and non alphanumeric characters removed). However, in the
check enforcing this uniqueness, we were incorrectly checking against the
existing saved entity of the same registrar, meaning that you couldn't update
the display name of a single registrar to a new value that canonicalized the
same (you would instead have to rename it to something else first that doesn't
canonicalize the same, and then afterwards to the new desired value).

That didn't make sense, so now we exclude the existing registrar entity from
consideration when checking if there are conflicts.
2026-02-13 19:20:34 +00:00
3 changed files with 16 additions and 2 deletions

View File

@@ -400,7 +400,10 @@ abstract class CreateOrUpdateRegistrarCommand extends MutatingCommand {
if (registrarName != null && !registrarName.equals(oldRegistrarName)) {
String normalizedName = normalizeRegistrarName(registrarName);
for (Registrar registrar : Registrar.loadAll()) {
if (registrar.getRegistrarName() != null) {
// Only check against other registrars (i.e. not the existing version of this one), and
// which also have a display name set.
if (!registrar.getRegistrarId().equals(clientId)
&& registrar.getRegistrarName() != null) {
checkArgument(
!normalizedName.equals(normalizeRegistrarName(registrar.getRegistrarName())),
"The registrar name %s normalizes identically to existing registrar name %s",

View File

@@ -968,6 +968,14 @@ class UpdateRegistrarCommandTest extends CommandTestCase<UpdateRegistrarCommand>
() -> runCommand("--name tHeRe GiStRaR", "--force", "NewRegistrar"));
}
@Test
void testSuccess_updateSameRegistrar_registrarNameSimilarToExisting() throws Exception {
// Note that "The -- registrar" normalizes identically to "The Registrar", which is created by
// JpaTransactionManagerExtension.
runCommand("--name The -- registrar", "--force", "TheRegistrar");
assertThat(loadRegistrar("TheRegistrar").getRegistrarName()).isEqualTo("The -- registrar");
}
@Test
void testSuccess_poNumberNotSpecified_doesntWipeOutExisting() throws Exception {
Registrar registrar =

View File

@@ -22,12 +22,15 @@ find . -maxdepth 1 -type d -name "console-*" -exec rm -rf {} +
cd /jetty-base
echo "Running ${env}"
PROFILER_ARGS=""
# # Use the CONTAINER_NAME variable from Kubernetes YAML to set Cloud profiler args, enable it only in frontend and console.
# Use the CONTAINER_NAME variable from Kubernetes YAML to set Cloud profiler args, enable it only in frontend and console.
case "${CONTAINER_NAME}" in
"frontend"|"console")
PROFILER_ARGS="-agentpath:/opt/cprof/profiler_java_agent.so=-cprof_service=${CONTAINER_NAME},-cprof_enable_heap_sampling=true"
esac
java $PROFILER_ARGS \
# Allocate bigger than default fraction of available memory to the application, as it's running in a (single-purposed) container.
-XX:InitialRAMPercentage=50.0 \
-XX:MaxRAMPercentage=50.0 \
-Dgoogle.registry.environment=${env} \
-Djava.util.logging.config.file=/logging.properties \
-jar /usr/local/jetty/start.jar