[Java] User's Exception's metadata thrown by method FlightServerMiddleware.onCallStarted() getting override and set to empty value
- 主要言語
- Java
- スター
- 94
- フォーク
- 152
- 平均マージ
- 3日 16時間
- マージ済み PR(30日)
- 11
説明
### 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
コントリビューションガイド
調査の方向性
java/flight/flight-core/src/main/java/org/apache/arrow/flight/grpc/ServerInterceptorAdapter.java の interceptCall の catch ブロックから始め、次に FlightServerMiddleware.onCallStarted と StatusUtils を読みます。呼び出しが終了したときに FlightRuntimeException のメタデータが保持されることを確認し、クライアントが空の値ではなくカスタム trailer 値を受け取ることを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- grpc, java
- 領域
- api, backend
- issue の種類
- バグ
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 45/100