Skip to content

Conversation

BenWhitehead
Copy link
Collaborator

When a client is shutting down, the Channel pool will deliver an error to our stream observer. This could happen before we are able to actually write a message. Update GapicUnbufferedFinalizeOnCloseResumableWritableByteChannel to not attempt to pass null to ImmutableList.of().

Sample exception

java.lang.NullPointerException
	at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:906)
	at com.google.common.collect.SingletonImmutableList.<init>(SingletonImmutableList.java:41)
	at com.google.common.collect.ImmutableList.of(ImmutableList.java:101)
	at com.google.cloud.storage.GapicUnbufferedFinalizeOnCloseResumableWritableByteChannel$Observer.onError(GapicUnbufferedFinalizeOnCloseResumableWritableByteChannel.java:233)
	at com.google.api.gax.tracing.TracedClientStreamingCallable$TracedResponseObserver.onError(TracedClientStreamingCallable.java:167)
	at com.google.api.gax.grpc.GrpcExceptionTranslatingStreamObserver.onError(GrpcExceptionTranslatingStreamObserver.java:60)
	at com.google.api.gax.grpc.ApiStreamObserverDelegate.onError(ApiStreamObserverDelegate.java:55)
	at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:481)
	at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)
	at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)
	at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)
	at com.google.api.gax.grpc.ChannelPool$ReleasingClientCall$1.onClose(ChannelPool.java:570)

…erant

When a client is shutting down, the Channel pool will deliver an error to our stream observer. This could happen before we are able to actually write a message. Update GapicUnbufferedFinalizeOnCloseResumableWritableByteChannel to not attempt to pass null to ImmutableList.of().
@BenWhitehead BenWhitehead added the owlbot:ignore instruct owl-bot to ignore a PR label Jul 24, 2024
@BenWhitehead BenWhitehead requested a review from a team as a code owner July 24, 2024 16:14
@product-auto-label product-auto-label bot added size: s Pull request size is small. api: storage Issues related to the googleapis/java-storage API. labels Jul 24, 2024
Copy link
Contributor

@sydney-munro sydney-munro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for grabbing that error!

@sydney-munro sydney-munro merged commit 95697dd into main Jul 24, 2024
@sydney-munro sydney-munro deleted the fix-grpc-null-safe-onError branch July 24, 2024 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/java-storage API. owlbot:ignore instruct owl-bot to ignore a PR size: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants