Oxidaner commented on code in PR #3293:
URL: https://github.com/apache/dubbo-go/pull/3293#discussion_r3158813851
##########
graceful_shutdown/shutdown.go:
##########
@@ -76,26 +88,23 @@ func Init(opts ...Option) {
opt(newOpts)
}
+ storeShutdownConfig(newOpts.Shutdown)
+
// retrieve ShutdownConfig for gracefulShutdownFilter
- gracefulShutdownConsumerFilter, exist :=
extension.GetFilter(constant.GracefulShutdownConsumerFilterKey)
- if !exist {
- return
- }
- gracefulShutdownProviderFilter, exist :=
extension.GetFilter(constant.GracefulShutdownProviderFilterKey)
- if !exist {
- return
- }
- if filter, ok :=
gracefulShutdownConsumerFilter.(config.Setter); ok {
-
filter.Set(constant.GracefulShutdownFilterShutdownConfig, newOpts.Shutdown)
+ if gracefulShutdownConsumerFilter, exist :=
extension.GetFilter(constant.GracefulShutdownConsumerFilterKey); exist {
+ if filter, ok :=
gracefulShutdownConsumerFilter.(config.Setter); ok {
+
filter.Set(constant.GracefulShutdownFilterShutdownConfig, newOpts.Shutdown)
+ }
}
-
- if filter, ok :=
gracefulShutdownProviderFilter.(config.Setter); ok {
-
filter.Set(constant.GracefulShutdownFilterShutdownConfig, newOpts.Shutdown)
+ if gracefulShutdownProviderFilter, exist :=
extension.GetFilter(constant.GracefulShutdownProviderFilterKey); exist {
+ if filter, ok :=
gracefulShutdownProviderFilter.(config.Setter); ok {
+
filter.Set(constant.GracefulShutdownFilterShutdownConfig, newOpts.Shutdown)
+ }
Review Comment:
我觉得filter 缺失不应该阻止 storeShutdownConfig 和 internal signal 直接返回, 也不应该阻止另一个存在的
filter 被配置
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]