apache / apache/dubbo

原生grpc迁移至dubbo tri协议问题汇总

Open
#9,342 12 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
41.6k
Forks
26.4k
Avg merge
15h 13m
Merged PRs (30d)
4

Description

## tri协议,中文异常乱码
Filter中抛出错误:
```java
throw new BusinessException("错误的token");
```

得到结果:中文乱码
```json
{
"error": "13 INTERNAL: Exception in invoker chain :???token"
}
```

## tri协议,在异常中加入无意义内容(`Exception in invoker chain :`),导致前端不方便提示异常
```java
public abstract class AbstractServerStream extends AbstractStream implements Stream {
public void execute(Runnable runnable) {
try {
super.execute(() -> {
try {
runnable.run();
} catch (Throwable t) {
LOGGER.error("Exception processing triple message", t);
transportError(GrpcStatus.fromCode(GrpcStatus.Code.INTERNAL)
.withDescription("Exception in invoker chain :" + t.getMessage())
.withCause(t));
}
});
} catch (RejectedExecutionException e) {
LOGGER.error("Provider's thread pool is full", e);
transportError(GrpcStatus.fromCode(GrpcStatus.Code.RESOURCE_EXHAUSTED)
.withDescription("Provider's thread pool is full"));
} catch (Throwable t) {
LOGGER.error("Provider submit request to thread pool error ", t);
transportError(GrpcStatus.fromCode(GrpcStatus.Code.INTERNAL)
.withCause(t)
.withDescription("Provider's error"));
}
}
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.