Comments (2)
We now have a quick and dirty fix in 1926856.
Maybe we should refactor the HTTP protocol implementation to get a better resolution.
from starlight.
那这次请求,是没有返回的,客户端直接报异常?解析不出请求,break了(NotEnoughDataException)。这个框架,是不是没有拆包,粘包的解决方案?
public void channelRead0(ChannelHandlerContext ctx, Object in) throws Exception {
ChannelInfo channelInfo = ChannelInfo.getServerChannelInfo(ctx.channel());
ByteBuf msg = (ByteBuf) in;
int len = msg.readableBytes();
if (len > 0) {
channelInfo.getRecvBuf().addBuffer(msg.retain());
DecodeWorkTask[] tasks = new DecodeWorkTask[64];
int i = 0;
while (channelInfo.getRecvBuf().readableBytes() > 0) {
try {
Object packet = decodeHeader(ctx, channelInfo, channelInfo.getRecvBuf());
DecodeWorkTask task = new DecodeWorkTask(rpcServer, packet, channelInfo.getProtocol(), ctx);
tasks[i++] = task;
if (i == 64) {
rpcServer.getThreadPool().submit(tasks, 0, i);
i = 0;
}
} catch (NotEnoughDataException ex1) {
break;
} catch (TooBigDataException ex2) {
throw new RpcException(RpcException.SERIALIZATION_EXCEPTION, ex2);
} catch (BadSchemaException ex3) {
throw new RpcException(RpcException.SERIALIZATION_EXCEPTION, ex3);
}
}
if (i > 0) {
rpcServer.getThreadPool().submit(tasks, 0, i);
}
}
}
from starlight.
Related Issues (20)
- Why NShead protocol can't coexistence with other protocols
- 请问下rpc server端能支持返回空对象吗 HOT 1
- bug fix of hulu protocol attachment
- brpc-java RpcServer.shutdown()报错 HOT 1
- com.baidu.brpc.naming.HealthyCheckTimer 健康检查逻辑问题
- 这是什么代码?
- Java brpc client 如何获取 远端的ip port HOT 2
- HealthyCheckTimer 发现可用机器列表bug,如果机器重启,roundRobin会导致流量分配不均
- 怎么支持广播
- 问下brpc-java有计划捐给apache吗?
- 请问brpc-java不支持一致性hash负载均衡策略吗? HOT 1
- BaiduRpcProtocol第102行,会产生ClassCastException HOT 2
- DEMO信息缺失、勘误和问题请教
- 请教DEMO相关问题 HOT 2
- 有计划支持RDMA吗 HOT 2
- 现在的版本不支持JDK17吗 HOT 1
- com.baidu.cloud:spring-cloud-baidu-thirdparty-commons:jar:2022.2.0 与 Netty Epoll 冲突 HOT 3
- can increase the network usage for reading data from cpp server by java client HOT 2
- Java版本支持streaming HOT 1
- BaiduBrpcProtocol 协议存在bytebuf over release 问题 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from starlight.