-
Notifications
You must be signed in to change notification settings - Fork 15.9k
Closed
Labels
untriagedauto added to all issues by default when created.auto added to all issues by default when created.
Description
What version of protobuf and what language are you using?
Version: main/v3.25.8
Language: Java
What operating system (Linux, Windows, ...) and version?
Linux
What runtime / compiler are you using (e.g., python version or gcc version)
Java17
What did you do?
On a Java webServer producing a lot of protoc2 messages, upgrade from 3.25.3 to 3.25.8
What did you expect to see
No functional change
What did you see instead?
Degraded performance, pinpointed to thread contention for method call Set.add in this code
private static final Set<String> loggedPre22TypeNames
= Collections.synchronizedSet(new HashSet<String>()); // <-- synchronizedSet causing locking
static void warnPre22Gencode(Class<?> messageClass) {
// ...
if (!loggedPre22TypeNames.add(messageName)) { // <---- thread contention here
return;
}
logger.warning(vulnerabilityMessage);
}
Related changes:
- https://github.com/protocolbuffers/protobuf/pull/20084/files Add a ExtensionsImmutable check poison pill
- Weaken Failure to warning in 320eafa
- Prevent multiple logging in https://github.com/protocolbuffers/protobuf/pull/21754/files
Metadata
Metadata
Assignees
Labels
untriagedauto added to all issues by default when created.auto added to all issues by default when created.