-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GrpcStorageOptions with setAttemptDirectPath(true) doesn't work with native image #2716
Comments
Attached is the output of the graalvm tracing agent included in a java program that downloads a 128MiB object 10 times. Collected from the following jvm
|
Failures all appear to be related to protobuf generated classes. Our own code generation, generates the necessary reflect-config.json https://github.com/googleapis/java-storage/blob/v2.43.0/gapic-google-cloud-storage-v2/src/main/resources/META-INF/native-image/com.google.storage.v2/reflect-config.json Quick and dirty program to generate reflect-config entries for all of grpc: // uses io.github.classgraph:classgraph:4.8.176
try (ScanResult scanResult =
new ClassGraph()
.enableAllInfo()
.acceptPackages("io.grpc")
.scan()) {
String json = Stream.of(
scanResult.getSubclasses(GeneratedMessageV3.class).stream(),
scanResult.getSubclasses(AbstractMessage.Builder.class).stream(),
scanResult.getAllEnums()
.filter(ci -> ci.implementsInterface(ProtocolMessageEnum.class))
.stream()
)
.flatMap(s -> s)
.map(ClassInfo::getName)
.sorted()
.map(name -> String.format("""
{
"name": "%s",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allPublicMethods": true,
"allDeclaredClasses": true,
"allPublicClasses": true
}""", name))
.collect(Collectors.joining(",\n"));
System.out.println(json);
} |
…th to work Add reflect-config for each of grpc's protobuf messages, builders and enums. Fixes #2716
…th to work Add reflect-config for each of grpc's protobuf messages, builders and enums. Fixes #2716
Error message
The text was updated successfully, but these errors were encountered: