apache / apache/arrow-java

[Java] User's Exception's metadata thrown by method FlightServerMiddleware.onCallStarted() getting override and set to empty value

Aberta
#448 0 comentários 0 reações 0 responsáveis Ver no GitHub
Type: bug
Linguagem predominante
Java
Estrelas
94
Forks
152
Merge médio
3d 16h
PRs com merge (30d)
11

Descrição

### Describe the bug, including details regarding any error messages, version, and platform.

In flight producer , User is throwing StatusRuntimeException having metadata with custom error message from the implementation class of [FlightServerMiddleware.onCallStarted](https://github.com/apache/arrow/blob/main/java/flight/flight-core/src/main/java/org/apache/arrow/flight/FlightServerMiddleware.java#L52) ,
eg:
`
Metadata trailers=new Metadata();
trailers.put(Metadata.key.of("custom_msg",Metadata.ASCII_STRING_MARSHALLER),"custom error msg");
throw StatusUtils.fromGrpcRuntimeException(new StatusRuntimeException(Status.UNAUTHENTICATED,trailers) );
`
But this is getting override in in catch block of [ServerInterceptorAdapter.interceptCall](https://github.com/apache/arrow/blob/ded148c2ef5dd441a3b6ab9496d0ed0aeb940f71/java/flight/flight-core/src/main/java/org/apache/arrow/flight/grpc/ServerInterceptorAdapter.java#L104) ,

Because of this at flight client side user is not able to propagate meaning error message , Only correct status is received at client side .

Expectation :
Metadata from FlightRuntimeException should be used while closing the call .
[ServerInterceptorAdapter.interceptCall](https://github.com/apache/arrow/blob/ded148c2ef5dd441a3b6ab9496d0ed0aeb940f71/java/flight/flight-core/src/main/java/org/apache/arrow/flight/grpc/ServerInterceptorAdapter.java#L104)
`
call.close(StatusUtils.toGrpcStatus(e.status()), e.status().metadata());
`

### Component(s)

FlightRPC, Java

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

Comece em java/flight/flight-core/src/main/java/org/apache/arrow/flight/grpc/ServerInterceptorAdapter.java, no bloco catch de interceptCall, e depois leia FlightServerMiddleware.onCallStarted e StatusUtils. Verifique se os metadados de uma FlightRuntimeException são retidos quando a chamada é encerrada e confirme que o cliente recebe o valor de trailer personalizado em vez de um valor vazio.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
grpc, java
Domínio
api, backend
Tipo de issue
Bug
Dificuldade
2/5
Tempo estimado
1-3 horas
Status de atividade
Estagnada
Clareza
Claramente especificada
Facilidade para iniciantes
45/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.