-
Notifications
You must be signed in to change notification settings - Fork 864
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
java.lang.IllegalArgumentException: Self-suppression not permitted #5239
Comments
@trask https://github.com/open-telemetry/opentelemetry-java/issues/7848 that is a duplicate question but not resove, so will there be a fix plan? |
@971758118 are you able to provide a fix? Thanks! |
Here's a fix, but it requires an SDK fix in ProtoSerializer.java output.flush() and idCache.clear() surround with try/catch @OverRide |
I meant, can you submit a PR for the fix? |
… permitted Issues open-telemetry#5239 Signed-off-by: dujiaxu <dujiaxu@xiaomi.com>
Describe the bug
java.lang.IllegalArgumentException: Self-suppression not permitted
at io.opentelemetry.exporter.internal.marshal.Marshaler.b(Marshaler.java:4)
at io.opentelemetry.exporter.internal.okhttp.ProtoRequestBody.writeTo
Steps to reproduce
ProtoRequestBody
public void writeTo(BufferedSink paramBufferedSink) throws IOException {
this.marshaler.writeBinaryTo(paramBufferedSink.outputStream());
}
Marshaler
public final void writeBinaryTo(OutputStream paramOutputStream) throws IOException {
ProtoSerializer protoSerializer = new ProtoSerializer(paramOutputStream);
try {
writeTo(protoSerializer);
return;
} finally {
try {
protoSerializer.close();
} finally {
protoSerializer = null;
}
}
}
ProtoSerializer implements AutoCloseable, so close() will execute
public void close() throws IOException {
this.output.flush();
this.idCache.clear();
}
in Marshaler.writeBinaryTo(), try() and close() throw a same Throwable instance , so Throwable.addSuppressed() will throw new IllegalArgumentException(SELF_SUPPRESSION_MESSAGE, exception);
What version are you using?
1.21.1
The text was updated successfully, but these errors were encountered: