Skip to content
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 #7848

Closed
971758118 opened this issue Feb 17, 2023 · 2 comments
Closed

java.lang.IllegalArgumentException:Self-suppression not permitted #7848

971758118 opened this issue Feb 17, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@971758118
Copy link

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

@971758118 971758118 added the bug Something isn't working label Feb 17, 2023
@trask
Copy link
Member

trask commented Feb 17, 2023

closing in favor of open-telemetry/opentelemetry-java#5239, since I think the relevant code/fix would be there

@trask trask closed this as completed Feb 17, 2023
@971758118
Copy link
Author

971758118 commented Feb 20, 2023

@trask open-telemetry/opentelemetry-java#5239 that is a duplicate question but not resove, so will there be a fix plan?
eg:
ProtoSerializer.java
@OverRide
public void close() throws IOException {
try {
output.flush();
idCache.clear();
} catch (IOException e) {
throw new IOException(e);
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants