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:
CC @esrauchg @zhangskz
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.addin this codeRelated changes:
CC @esrauchg @zhangskz