apache / apache/arrow-java

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

未关闭
#448 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
Type: bug
主要语言
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

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。