Comments (4)
@icodening @EarthChen PTAL
from dubbo.
@AlbumenJ
我断点看了下, 3.2.9在初始化NettyConnectionClient时, 新增了
private void initBootstrap() {
...
nettyBootstrap.handler(new ChannelInitializer<SocketChannel>() {
@Override
protected void initChannel(SocketChannel ch) {
...
ch.closeFuture().addListener(channelFuture -> doClose());
// TODO support Socks5
}
});
this.bootstrap = nettyBootstrap;
}
consumer接收到实例下线时通知时, 会触发一次Invoker#destory方法, 此时会执行一次 AbstractConnectionClient#release, 这里会执行第一次NettyConnectionClient#close方法.
之后释放连接时, 会由Netty的closeFuture触发第二次#close方法.
可以加个判断修复
@Override
protected void doClose() {
// AbstractPeer close can set closed true.
if (isClosed()) {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(String.format("Connection:%s freed ", this));
}
final io.netty.channel.Channel current = getNettyChannel();
if (current != null) {
current.close();
}
this.channel.set(null);
// 已经触发过一次close通知, 不需要再执行
if(!closePromise.isSuccess()) {
closePromise.setSuccess(null);
}
}
}
from dubbo.
Can you please submit a PR?
from dubbo.
@AlbumenJ 我断点看了下, 3.2.9在初始化NettyConnectionClient时, 新增了
private void initBootstrap() { ... nettyBootstrap.handler(new ChannelInitializer<SocketChannel>() { @Override protected void initChannel(SocketChannel ch) { ... ch.closeFuture().addListener(channelFuture -> doClose()); // TODO support Socks5 } }); this.bootstrap = nettyBootstrap; }
修改成ch.closeFuture().addListener(channelFuture -> close());
就好了呗,预期结果应该是不会进入两次doClose
的逻辑
from dubbo.
Related Issues (20)
- [Bug] 3.2.12 The consumer does not automatically reconnect to the triple stream after the provider restarts HOT 6
- [Feature] [Dubbo-python] Code style and CI process updates
- [Feature] Update issue template
- [Feature] TotalPendingBytes size overflow Exception HOT 1
- [Bug] The sample code dubbo samples SSL on the official website cannot pass one-way authentication, but can be executed normally with two-way authentication configuration HOT 1
- [Bug] dubbo-3.3.0-beta5 start warning exporterMap can not be null HOT 2
- [Bug] ConfigurableMetadataServiceExporter.export cause IndexOutOfBoundsException HOT 1
- [Bug] In native-image mode,ApplicationModel.defaultModel().getApplicationConfigManager().getProtocols() is empty.
- Dubbo Java 2.7.1 occasionally problem. When the provider of dubbo deploying, and the IP is changed. The new provider's IP has been pushed to dubbo, but the error shows that the consumer still sends requests to the old IP that has been offline. HOT 2
- [Bug] Dubbo 2.7.23 Consumer not consuming properly when provider custom extends Dispatcher HOT 2
- dubbo rpc调用中使用get/post,ssl异常
- [Feature] Best Practices for Using Dubbo Stream
- [Bug] After running for a period of time, the provider is lost.
- [Bug] java.util.ArrayList cannot be assigned to 'java.util.List' HOT 2
- [Bug] 多注册中心下,一个注册中心挂了 导致客户端无法调用服务端,报cannot invoker Registry.getUrl Because this.url is null HOT 2
- [Bug] In Dubbo 3.3.0 & 3.2.16, when using AsyncContext for asynchronous service processing, during a loop of 10,000 iterations, a java.util.concurrent.RejectedExecutionException: null is occasionally thrown.
- [Bug] In the Dubbo interface, the parameter type is defined as the parent class, but when the caller invokes the remote interface method, a subclass is passed as the parameter. This leads to an inability to deserialize the paramete HOT 2
- [Bug] application/x-www-form-urlencoded There is a problem with parameter parsing
- [Bug] Registry. check=false is not available under multiple registration centers
- [Bug] In the Dubbo interface, the parameter type is defined as the parent class, but when the caller invokes the remote interface method, a subclass is passed as the parameter. This leads to an inability to deserialize the parameter
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 dubbo.