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

Do not log gRPC CANCELLED exception in a client #5920

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

minwoox
Copy link
Member

@minwoox minwoox commented Sep 20, 2024

Motivation:
I found this log that is unnecessary when an XdsEndpointGroup is closed:

Unexpected exception while closing a request:
io.grpc.StatusRuntimeException: CANCELLED: Cancelled by client with StreamObserver.onError()
	at io.grpc.Status.asRuntimeException(Status.java:533)
	at com.linecorp.armeria.internal.common.grpc.StatusAndMetadata.asRuntimeException(StatusAndMetadata.java:53)
	at com.linecorp.armeria.internal.common.grpc.GrpcLogUtil.rpcResponse(GrpcLogUtil.java:62)
	at com.linecorp.armeria.internal.client.grpc.ArmeriaClientCall.close(ArmeriaClientCall.java:574)
	at com.linecorp.armeria.internal.client.grpc.ArmeriaClientCall.doCancel(ArmeriaClientCall.java:333)
	at com.linecorp.armeria.internal.client.grpc.ArmeriaClientCall.lambda$cancel$7(ArmeriaClientCall.java:312)
	at com.linecorp.armeria.common.DefaultContextAwareRunnable.run(DefaultContextAwareRunnable.java:45)
	at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173)
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166)
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469)
	at io.netty.channel.kqueue.KQueueEventLoop.run(KQueueEventLoop.java:300)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:994)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: io.grpc.StatusException: CANCELLED: shutdown
	at io.grpc.Status.asException(Status.java:541)
	at com.linecorp.armeria.xds.SotwXdsStream.stop(SotwXdsStream.java:121)
  ...

Motivation:
I found this log that is unnecessary when an `XdsEndpointGroup` is closed:
```
Unexpected exception while closing a request:
io.grpc.StatusRuntimeException: CANCELLED: Cancelled by client with StreamObserver.onError()
	at io.grpc.Status.asRuntimeException(Status.java:533)
	at com.linecorp.armeria.internal.common.grpc.StatusAndMetadata.asRuntimeException(StatusAndMetadata.java:53)
	at com.linecorp.armeria.internal.common.grpc.GrpcLogUtil.rpcResponse(GrpcLogUtil.java:62)
	at com.linecorp.armeria.internal.client.grpc.ArmeriaClientCall.close(ArmeriaClientCall.java:574)
	at com.linecorp.armeria.internal.client.grpc.ArmeriaClientCall.doCancel(ArmeriaClientCall.java:333)
	at com.linecorp.armeria.internal.client.grpc.ArmeriaClientCall.lambda$cancel$7(ArmeriaClientCall.java:312)
	at com.linecorp.armeria.common.DefaultContextAwareRunnable.run(DefaultContextAwareRunnable.java:45)
	at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173)
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166)
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469)
	at io.netty.channel.kqueue.KQueueEventLoop.run(KQueueEventLoop.java:300)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:994)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: io.grpc.StatusException: CANCELLED: shutdown
	at io.grpc.Status.asException(Status.java:541)
	at com.linecorp.armeria.xds.SotwXdsStream.stop(SotwXdsStream.java:121)
  ...
```
@minwoox minwoox marked this pull request as draft September 20, 2024 08:08
@github-actions github-actions bot added the Stale label Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant