sofa-ark icon indicating copy to clipboard operation
sofa-ark copied to clipboard

Unloading modules using the combined deployment feature of sofa-ark does not release related connections such as redis, rpc, etc.

Open grindwheel opened this issue 5 years ago • 7 comments

现象是,多次部署加载与卸载模块时(该模块会创建redis连接,rpc连接),通过netstat发现,连接并未释放,每动态部署模块时,就会添加一个连接

grindwheel avatar Jul 30 '19 12:07 grindwheel

Hi @grindwheel, we detect non-English characters in the issue. This comment is an auto translation by @sofastack-robot to help other users to understand this issue.

We encourage you to describe your issue in English which is more friendly to other users.

The phenomenon is that when the load and unload module is deployed multiple times (the module will create a redis connection, rpc connection), through the netstat discovery, the connection is not released, each time the module is dynamically deployed, a connection is added.

sofastack-bot[bot] avatar Jul 30 '19 12:07 sofastack-bot[bot]

现象是,多次部署加载与卸载模块时(该模块会创建redis连接,rpc连接),通过netstat发现,连接并未释放,每动态部署模块时,就会添加一个连接

可以把你的 demo 提供下吗

glmapper avatar Jul 30 '19 12:07 glmapper

@glmapper 我完全集成的项目里了,demo不好提供,很好复现的,合并部署的功能,模块卸载有些是无法卸载的(socket连接,定时任务等),你们自己内部试下就知道了

grindwheel avatar Jul 31 '19 03:07 grindwheel

@glmapper 我完全集成的项目里了,demo不好提供,很好复现的,合并部署的功能,模块卸载有些是无法卸载的(socket连接,定时任务等),你们自己内部试下就知道了

OK ,我尝试下

glmapper avatar Jul 31 '19 12:07 glmapper

@glmapper 有结果吗

grindwheel avatar Aug 09 '19 07:08 grindwheel

@glmapper 有结果吗

类似问题我们遇到过,目前提供一种可行的方案是通过监听模块卸载事件或者 spring 上下文关闭事件来动态释放 socket 和 定时任务以及类似的例如缓存、线程池等

glmapper avatar Oct 23 '20 05:10 glmapper

cc @yuanyuancin 关注。

lylingzhen avatar Mar 28 '22 04:03 lylingzhen

建议按照 @glmapper 提供方式,如果还有问题可以重新打开 issue

lvjing2 avatar Aug 06 '23 08:08 lvjing2