fix(logging): preserve punctuation in formatted diagnostics (#8813)

A lone apostrophe in a MessageFormat log pattern opens a quoted section, so 22 warnings that take arguments printed without their possessives and quote marks, such as "Floci's", "'available'" and the PostgreSQL message codes. Each apostrophe is now doubled. The three patterns without arguments stay as they are, since JBoss LogManager prints a pattern with no arguments as written.
This commit is contained in:
Jackson Price authored and GitHub committed 2026-11-17 22:50:30 -04:00
1 parent 39a4afc722
commit 118ec83730
18 files changed
+22 -22

No files matched your search

@@ -265,7 +265,7 @@ public final class ContainerCaBundle {
try {
return Optional.of(sslContext(bundle.get()));
} catch (IOException | GeneralSecurityException e) {
LOG.warnv(e, "Cannot read {0}; Floci's own HTTPS clients trust the JVM's roots only", bundle.get());
LOG.warnv(e, "Cannot read {0}; Floci''s own HTTPS clients trust the JVM''s roots only", bundle.get());
return Optional.empty();
}
}
@@ -342,7 +342,7 @@ public final class FlociCertificateAuthority {
if (Files.getFileAttributeView(keyFile.getParent(), PosixFileAttributeView.class) != null) {
Files.createFile(keyFile, PosixFilePermissions.asFileAttribute(PosixFilePermissions.fromString("rw-------")));
} else {
LOG.warnv("TLS: {0} is written with the file system's default permissions because it has no POSIX "
LOG.warnv("TLS: {0} is written with the file system''s default permissions because it has no POSIX "
+ "permissions; restrict it to your own account yourself", keyFile);
}
Files.writeString(keyFile, pem);
@@ -59,7 +59,7 @@ public class PartitionStartupValidator {
Optional<AwsPartition> regionPartition = AwsPartitions.forRegion(defaultRegion);
if (regionPartition.isEmpty()) {
LOG.warnv("floci.default-region {0} is not a published AWS region in the vendored partition data; "
+ "treating it as partition {1}. Run 'make aws-data-sync' if AWS has launched it since.",
+ "treating it as partition {1}. Run ''make aws-data-sync'' if AWS has launched it since.",
defaultRegion, partition.id());
} else if (!regionPartition.get().id().equals(partition.id())) {
throw new IllegalStateException("floci.partitions.id is '" + partition.id()
@@ -245,7 +245,7 @@ public class EmbeddedDnsServer {
// The failure handler has already logged why the bind failed; containers keep resolving without it.
} catch (TimeoutException e) {
LOG.warnv("Embedded DNS server on {0}:53 did not finish binding within {1} seconds; containers "
+ "launched before it does are not given Floci's resolver",
+ "launched before it does are not given Floci''s resolver",
address, String.valueOf(CONTAINER_LISTENER_WAIT_SECONDS));
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
@@ -483,7 +483,7 @@ public class DockerClientProducer {
connection.tlsCertPath().ifPresent(path -> {
if (connection.skipTlsVerify()) {
LOG.infov("Using TLS material from the active Docker context at: {0}, with server "
+ "certificate verification skipped per the context's SkipTLSVerify setting.",
+ "certificate verification skipped per the context''s SkipTLSVerify setting.",
path);
builder.withCustomSslConfig(new SkipVerifySslConfig(path.toString()));
} else {
@@ -22,11 +22,11 @@ final class StorageQuarantine {
try {
Files.move(filePath, quarantine, StandardCopyOption.REPLACE_EXISTING);
log.errorv(cause, "Failed to load persisted data from {0}; moved the unreadable file to "
+ "{1} and started with an empty store. This store's state was lost.",
+ "{1} and started with an empty store. This store''s state was lost.",
filePath, quarantine);
} catch (IOException moveError) {
log.errorv(cause, "Failed to load persisted data from {0}; could not quarantine it ({1}). "
+ "Starting with an empty store. This store's state was lost.",
+ "Starting with an empty store. This store''s state was lost.",
filePath, moveError.getMessage());
}
}
@@ -86,7 +86,7 @@ public abstract class MinuteMetricsPublisher<T> {
try {
targets = collectTargets(now);
} catch (RuntimeException e) {
LOG.warnv(e, "Collecting {0} metric targets failed; this minute's samples are dropped", namespace);
LOG.warnv(e, "Collecting {0} metric targets failed; this minute''s samples are dropped", namespace);
return;
}
for (T target : targets) {
@@ -5413,7 +5413,7 @@ public class CodeArtifactService implements Resettable {
if (!isValidPackageToken(packageName) || !isValidPackageToken(version)
|| (namespace != null && !isValidPackageToken(namespace))) {
LOG.warnv("Skipping readme capture for {0}/{1} package ''{2}'' version ''{3}'': the namespace, name, "
+ "or version contains a character ('#', '/', or whitespace) a real CodeArtifact package "
+ "or version contains a character (''#'', ''/'', or whitespace) a real CodeArtifact package "
+ "coordinate cannot have.", domain, repository, packageName, version);
return;
}
@@ -6219,7 +6219,7 @@ public class CodeArtifactService implements Resettable {
long packageFenceSnapshot) {
if (!isValidPackageToken(packageName) || (namespace != null && !isValidPackageToken(namespace))) {
LOG.warnv("Skipping container-backed asset byte accounting for {0}/{1} package ''{2}'': namespace or "
+ "package name contains a character ('#', '/', or whitespace) a real CodeArtifact package "
+ "package name contains a character (''#'', ''/'', or whitespace) a real CodeArtifact package "
+ "coordinate cannot have.", domain, repository, packageName);
return;
}
@@ -6289,7 +6289,7 @@ public class CodeArtifactService implements Resettable {
String repository, String repositoryContainerId, String format, String namespace, String packageName) {
if (!isValidPackageToken(packageName) || (namespace != null && !isValidPackageToken(namespace))) {
LOG.warnv("Ignoring a native unpublish of {0}/{1} package ''{2}'': namespace or package name contains "
+ "a character ('#', '/', or whitespace) a real CodeArtifact package coordinate cannot have.",
+ "a character (''#'', ''/'', or whitespace) a real CodeArtifact package coordinate cannot have.",
domain, repository, packageName);
return;
}
@@ -82,7 +82,7 @@ public class DocDbContainerManager {
if (!dockerUnavailableLogged) {
dockerUnavailableLogged = true;
LOG.warnv("No Docker daemon is reachable from Floci ({0}). DocumentDB metadata "
+ "operations keep working and clusters still reach 'available', but they "
+ "operations keep working and clusters still reach ''available'', but they "
+ "have no backing MongoDB container until a daemon becomes reachable.",
e.getMessage());
}
@@ -115,7 +115,7 @@ public class ElastiCacheContainerManager {
if (!dockerUnavailableLogged) {
dockerUnavailableLogged = true;
LOG.warnv("No Docker daemon is reachable from Floci ({0}). ElastiCache metadata "
+ "operations keep working and replication groups still reach 'available', "
+ "operations keep working and replication groups still reach ''available'', "
+ "but they have no backing Valkey container until a daemon becomes "
+ "reachable.", e.getMessage());
}
@@ -93,7 +93,7 @@ public class ElastiCacheMemcachedContainerManager {
if (!dockerUnavailableLogged) {
dockerUnavailableLogged = true;
LOG.warnv("No Docker daemon is reachable from Floci ({0}). ElastiCache metadata "
+ "operations keep working and cache clusters still reach 'available', but "
+ "operations keep working and cache clusters still reach ''available'', but "
+ "they have no backing Memcached container until a daemon becomes "
+ "reachable.", e.getMessage());
}
@@ -2990,7 +2990,7 @@ public class EmrService implements Resettable, StoredResourceArns, ContainerTear
if (copies != null) {
return copies;
}
LOG.warnv("The dfs.replication of EMR cluster {0}, {1}, is not a whole number above zero, so it keeps EMR's"
LOG.warnv("The dfs.replication of EMR cluster {0}, {1}, is not a whole number above zero, so it keeps EMR''s"
+ " default", cluster.getId(), configured);
}
int core = cluster.getProvisionedCoreNodes();
@@ -102,7 +102,7 @@ public class MemoryDbContainerManager {
if (!dockerUnavailableLogged) {
dockerUnavailableLogged = true;
LOG.warnv("No Docker daemon is reachable from Floci ({0}). MemoryDB metadata "
+ "operations keep working and clusters still reach 'available', but they "
+ "operations keep working and clusters still reach ''available'', but they "
+ "have no backing Redis/Valkey container until a daemon becomes reachable.",
e.getMessage());
}
@@ -85,7 +85,7 @@ public class NeptuneContainerManager {
if (!dockerUnavailableLogged) {
dockerUnavailableLogged = true;
LOG.warnv("No Docker daemon is reachable from Floci ({0}). Neptune metadata "
+ "operations keep working and clusters still reach 'available', but they "
+ "operations keep working and clusters still reach ''available'', but they "
+ "have no backing graph database container until a daemon becomes "
+ "reachable.", e.getMessage());
}
@@ -219,7 +219,7 @@ public class RdsContainerManager implements RdsBackendGate, RdsBackendEndpointRe
if (!dockerUnavailableLogged) {
dockerUnavailableLogged = true;
LOG.warnv("No Docker daemon is reachable from Floci ({0}). RDS metadata operations "
+ "keep working and DB instances still reach 'available', but they have no "
+ "keep working and DB instances still reach ''available'', but they have no "
+ "backing database container until a daemon becomes reachable.",
e.getMessage());
}
@@ -724,7 +724,7 @@ public class PostgresProtocolHandler {
return null;
}
if (type != 'p') {
LOG.warnv("Expected PasswordMessage ('p'), got {0}", (char) type);
LOG.warnv("Expected PasswordMessage (''p''), got {0}", (char) type);
return null;
}
int length = PostgresWire.checkedLength(PostgresWire.readInt32(in), 5, MAX_HANDSHAKE_PACKET_LENGTH, "password message");
@@ -773,7 +773,7 @@ public class PostgresProtocolHandler {
while (true) {
int type = readAuthenticationType(in);
if (type != 'R') {
LOG.warnv("Expected Authentication ('R') from backend, got type={0}", type);
LOG.warnv("Expected Authentication (''R'') from backend, got type={0}", type);
return false;
}
byte[] body = PostgresWire.readBody(in, 8, MAX_HANDSHAKE_PACKET_LENGTH, packetName);
@@ -1037,7 +1037,7 @@ public final class S3CopySimulator {
onStatusChange.accept(status);
}
if (status != 'E') {
LOG.warnv("backend returned unexpected transaction status {0} instead of 'E' after abort query", status);
LOG.warnv("backend returned unexpected transaction status {0} instead of ''E'' after abort query", status);
return false;
}
return true;
@@ -240,7 +240,7 @@ public class LambdaTaskAuthorizer {
if (target.isEmpty()) {
// STS refuses a role that does not exist as it refuses one the caller may not assume,
// and no policy of the role took part, so the message names none.
LOG.infov("Role {0} named by a task's Credentials does not exist", roleArn);
LOG.infov("Role {0} named by a task''s Credentials does not exist", roleArn);
return Optional.of(denied(callerRoleArn, ASSUME_ROLE, roleArn, null));
}
String targetRoleArn = target.get().getArn();