PANKAJ9768 opened a new issue, #44937:
URL: https://github.com/apache/arrow/issues/44937

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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to