[Java] User's Exception's metadata thrown by method FlightServerMiddleware.onCallStarted() getting override and set to empty value
- 主要語言
- Java
- 星號
- 94
- 分支
- 152
- 平均合併
- 3 天 16 小時
- 30 天內合併 PR
- 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