Skip to content

GrpcExceptionHandledServerCall tries to merge null trailers #229

@emil-e

Description

@emil-e

At...

statusException.getTrailers() can (and very often is) null, thus the @Nullable annotation. This causes exceptions since Metadata.merge does not deal with null values:

Exception in thread "DefaultDispatcher-worker-1" java.lang.NullPointerException: Cannot invoke "io.grpc.Metadata.isEmpty()" because "other" is null
at io.grpc.Metadata.merge(Metadata.java:508)
at org.springframework.grpc.server.exception.GrpcExceptionHandledServerCall.close(GrpcExceptionHandledServerCall.java:39)
at io.grpc.PartialForwardingServerCall.close(PartialForwardingServerCall.java:48)
at io.grpc.ForwardingServerCall.close(ForwardingServerCall.java:22)
at io.grpc.ForwardingServerCall$SimpleForwardingServerCall.close(ForwardingServerCall.java:44)
at io.micrometer.core.instrument.binder.grpc.ObservationGrpcServerCall.close(ObservationGrpcServerCall.java:71)
at io.grpc.kotlin.ServerCalls$serverCallListener$rpcJob$1.invokeSuspend(ServerCalls.kt:268)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions