apache / apache/arrow-java

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

Aperta
#448 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Type: bug
Lingua principale
Java
Stelle
94
Fork
152
Merge medio
3g 16h
PR unite (30g)
11

Descrizione

### 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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia in java/flight/flight-core/src/main/java/org/apache/arrow/flight/grpc/ServerInterceptorAdapter.java nel blocco catch di interceptCall, quindi leggi FlightServerMiddleware.onCallStarted e StatusUtils. Verifica che i metadati di una FlightRuntimeException vengano mantenuti quando la chiamata viene chiusa e conferma che il client riceva il valore del trailer personalizzato invece di uno vuoto.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
grpc, java
Ambito
api, backend
Tipo di issue
Bug
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.