Remove logging of context mismatch which will always be logged. (#2970)

This commit is contained in:
Anuraag Agrawal 2021-05-13 02:02:47 +09:00 committed by GitHub
parent 01a7f54197
commit 3edc4a7f77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 12 deletions

View File

@ -59,18 +59,6 @@ public final class ContextStorageBridge extends Context.Storage {
@Override
public void detach(Context toDetach, Context toRestore) {
io.opentelemetry.context.Context otelContext = io.opentelemetry.context.Context.current();
Context current = otelContext.get(GRPC_CONTEXT);
if (current != toDetach) {
// Log a severe message instead of throwing an exception as the context to attach is assumed
// to be the correct one and the unbalanced state represents a coding mistake in a lower
// layer in the stack that cannot be recovered from here.
logger.log(
Level.SEVERE,
"Context was not attached when detaching",
new Throwable().fillInStackTrace());
}
Scope scope = OTEL_SCOPE.get(toRestore);
if (scope == null) {
logger.log(