-
Notifications
You must be signed in to change notification settings - Fork 26.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Module config no support unexport #10380
Closed
owen200008
wants to merge
4
commits into
apache:3.0
from
owen200008:module_config_no_support_unexport
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ServiceBean/Config has removed from configManger in here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it only destroy call
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
你可以试下 unexport 然后再export 同样的service
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
正常就应该是在ModuleModel销毁的时候对configManger做清空操作的。
ServiceConfig的export和unexport内部都不应该对configManager进行添加或者移除操作。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
应该这个词有点太随便了
当一个ref unexport的时候
当然这个都是要跟设计有关,但是从来没说过一个service和ref是单例的,只有在destroy才需要销毁,至少2.7.x的service和ref的生命周期是跟unexport相关的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
写这里原因是,加入是bean做的,所以删除也由它管理
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以看如下demo,不是通过ServiceBean的方式,直接是ServiceConfig。
我上面表达的意思是Spring配置方式不是ServiceBean/Config唯一加入configManager的方式。如果按照如下这配置方式,按照目前pr的修改逻辑,在unexport就不会从configManager移除了。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
加入和删除一起迁移到父类我觉得是OK的
目前还是保持统一在bean中加入和删除更合适
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我又想了下,针对你上面提到的。在ModuleDeployer销毁的时候,在每个ServiceConfig#unexport发生之后就立马做了configManager的remove操作(所以你说的12情况都不存在),只是这个时机没有放在unexport里面。而且目前unexport操作目前基本都是在ModuleDeployer销毁时调用的,除非说使用者自己去执行了unexport,才出现你说的情况,但一般使用者不会去这么做。
目前的设计是执行export之前,ServiceConfig已经加入到了configManager,unexport之后才将ServiceConfig从configManager移除,即export和unexport内部都没有关注对configManager的添加或移除操作。
不过按照目前的修改,将ServiceConfig的从configManager的移除逻辑放在unexport方法中也没问题。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里需要考虑下循环依赖的问题,ModuleModel.destroy -> foreach -> ServiceBean.unexport -> ModuleModel.remove