This is an automated email from the ASF dual-hosted git repository.

xuetaoli pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git


The following commit(s) were added to refs/heads/develop by this push:
     new 5c6bee720 refactor: migrate hystrix filter from main repository (#3253)
5c6bee720 is described below

commit 5c6bee7207d5e6c60fc81e3ebfd3bc149f29135f
Author: Zecheng Zhu <[email protected]>
AuthorDate: Mon Mar 23 11:26:46 2026 +0800

    refactor: migrate hystrix filter from main repository (#3253)
    
    * refactor: remove hystrix filter from main repository
    
    * update unit test
    
    * clean up hystrix
    
    * doc: add hystrix migration note to filter README
---
 common/constant/key.go                             |   2 -
 common/extension/filter.go                         |   2 +-
 filter/README.md                                   |   4 +-
 filter/filter_impl/import.go                       |   1 -
 filter/hystrix/filter.go                           | 335 ---------------------
 filter/hystrix/filter_test.go                      | 246 ---------------
 go.mod                                             |   1 -
 go.sum                                             |   1 -
 imports/imports.go                                 |   1 -
 server/options.go                                  |   8 -
 server/options_test.go                             |   9 -
 .../cmd/testGenCode/template/newApp/go.mod         |   1 -
 .../cmd/testGenCode/template/newDemo/go.mod        |   1 -
 tools/dubbogo-cli/generator/application/gomod.go   |   1 -
 tools/dubbogo-cli/generator/sample/mod.go          |   1 -
 15 files changed, 3 insertions(+), 611 deletions(-)

diff --git a/common/constant/key.go b/common/constant/key.go
index 1880faf67..b6d32a88c 100644
--- a/common/constant/key.go
+++ b/common/constant/key.go
@@ -109,8 +109,6 @@ const (
        GracefulShutdownProviderFilterKey    = "pshutdown"
        GracefulShutdownConsumerFilterKey    = "cshutdown"
        GracefulShutdownFilterShutdownConfig = 
"GracefulShutdownFilterShutdownConfig"
-       HystrixConsumerFilterKey             = "hystrix_consumer"
-       HystrixProviderFilterKey             = "hystrix_provider"
        MetricsFilterKey                     = "metrics"
        SeataFilterKey                       = "seata"
        SentinelProviderFilterKey            = "sentinel-provider"
diff --git a/common/extension/filter.go b/common/extension/filter.go
index da0458ee8..86c065302 100644
--- a/common/extension/filter.go
+++ b/common/extension/filter.go
@@ -31,7 +31,7 @@ var (
 )
 
 // SetFilter sets the filter extension with @name
-// For example: hystrix/metrics/token/tracing/limit/...
+// For example: metrics/token/tracing/limit/...
 func SetFilter(name string, v func() filter.Filter) {
        filters.Register(name, v)
 }
diff --git a/filter/README.md b/filter/README.md
index 7ed092d12..1135c85d6 100644
--- a/filter/README.md
+++ b/filter/README.md
@@ -29,10 +29,10 @@ import _ "dubbo.apache.org/dubbo-go/v3/filter/filter_impl"
 - execlmt: Execute Limit Filter(https://github.com/apache/dubbo-go/pull/246)
 - generic: Generic Filter(https://github.com/apache/dubbo-go/pull/291)
 - gshutdown: Graceful Shutdown Filter
-- hystrix: Hystrix Filter(https://github.com/apache/dubbo-go/pull/133)
+- hystrix: Moved to 
[dubbo-go-extensions](https://github.com/apache/dubbo-go-extensions/tree/main/filter/hystrix)
 - metrics: Metrics Filter(https://github.com/apache/dubbo-go/pull/342)
 - seata: Seata Filter
 - sentinel: Sentinel Filter
 - token: Token Filter(https://github.com/apache/dubbo-go/pull/202)
 - tps: Tps Limit Filter(https://github.com/apache/dubbo-go/pull/237)
-- tracing: Tracing Filter(https://github.com/apache/dubbo-go/pull/335)
\ No newline at end of file
+- tracing: Tracing Filter(https://github.com/apache/dubbo-go/pull/335)
diff --git a/filter/filter_impl/import.go b/filter/filter_impl/import.go
index 2e389b90a..f22c14794 100644
--- a/filter/filter_impl/import.go
+++ b/filter/filter_impl/import.go
@@ -28,7 +28,6 @@ import (
        _ "dubbo.apache.org/dubbo-go/v3/filter/exec_limit"
        _ "dubbo.apache.org/dubbo-go/v3/filter/generic"
        _ "dubbo.apache.org/dubbo-go/v3/filter/graceful_shutdown"
-       _ "dubbo.apache.org/dubbo-go/v3/filter/hystrix"
        _ "dubbo.apache.org/dubbo-go/v3/filter/metrics"
        _ "dubbo.apache.org/dubbo-go/v3/filter/polaris/limit"
        _ "dubbo.apache.org/dubbo-go/v3/filter/seata"
diff --git a/filter/hystrix/filter.go b/filter/hystrix/filter.go
deleted file mode 100644
index 79cc70025..000000000
--- a/filter/hystrix/filter.go
+++ /dev/null
@@ -1,335 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Package hystrix provides hystrix filter.
-package hystrix
-
-import (
-       "context"
-       "fmt"
-       "reflect"
-       "regexp"
-       "sync"
-)
-
-import (
-       "github.com/afex/hystrix-go/hystrix"
-
-       "github.com/dubbogo/gost/log/logger"
-
-       perrors "github.com/pkg/errors"
-
-       "gopkg.in/yaml.v2"
-)
-
-import (
-       "dubbo.apache.org/dubbo-go/v3/common/constant"
-       "dubbo.apache.org/dubbo-go/v3/common/extension"
-       "dubbo.apache.org/dubbo-go/v3/config"
-       "dubbo.apache.org/dubbo-go/v3/filter"
-       "dubbo.apache.org/dubbo-go/v3/protocol/base"
-       "dubbo.apache.org/dubbo-go/v3/protocol/result"
-)
-
-const (
-       // HYSTRIX is the key used in filter configuration.
-       HYSTRIX = "hystrix"
-)
-
-var (
-       confConsumer       = &FilterConfig{}
-       confProvider       = &FilterConfig{}
-       configLoadMutex    = sync.RWMutex{}
-       consumerConfigOnce sync.Once
-       providerConfigOnce sync.Once
-)
-
-func init() {
-       extension.SetFilter(constant.HystrixConsumerFilterKey, 
newFilterConsumer)
-       extension.SetFilter(constant.HystrixProviderFilterKey, 
newFilterProvider)
-}
-
-// FilterError implements error interface
-type FilterError struct {
-       err           error
-       failByHystrix bool
-}
-
-func (hfError *FilterError) Error() string {
-       return hfError.err.Error()
-}
-
-// FailByHystrix returns whether the fails causing by Hystrix
-func (hfError *FilterError) FailByHystrix() bool {
-       return hfError.failByHystrix
-}
-
-// NewHystrixFilterError return a FilterError instance
-func NewHystrixFilterError(err error, failByHystrix bool) error {
-       return &FilterError{
-               err:           err,
-               failByHystrix: failByHystrix,
-       }
-}
-
-// Filter for Hystrix
-/**
- * You should add hystrix related configuration in provider or consumer config 
or both, according to which side you are to apply Filter.
- * For example:
- * filter_conf:
- *     hystrix:
- *      configs:
- *       # =========== Define config here ============
- *       "Default":
- *         timeout : 1000
- *         max_concurrent_requests : 25
- *         sleep_window : 5000
- *         error_percent_threshold : 50
- *         request_volume_threshold: 20
- *       "userp":
- *         timeout: 2000
- *         max_concurrent_requests: 512
- *         sleep_window: 4000
- *         error_percent_threshold: 35
- *         request_volume_threshold: 6
- *       "userp_m":
- *         timeout : 1200
- *         max_concurrent_requests : 512
- *         sleep_window : 6000
- *         error_percent_threshold : 60
- *         request_volume_threshold: 16
- *      # =========== Define error whitelist which will be ignored by Hystrix 
counter ============
- *         error_whitelist: [".*exception.*"]
- *
- *      # =========== Apply default config here ===========
- *      default: "Default"
- *
- *      services:
- *       "com.ikurento.user.UserProvider":
- *         # =========== Apply service level config ===========
- *         service_config: "userp"
- *         # =========== Apply method level config ===========
- *         methods:
- *           "GetUser": "userp_m"
- *           "GetUser1": "userp_m"
- */
-type Filter struct {
-       COrP     bool // true for consumer
-       res      map[string][]*regexp.Regexp
-       ifNewMap sync.Map
-}
-
-// Invoke is an implementation of filter, provides Hystrix pattern latency and 
fault tolerance
-func (f *Filter) Invoke(ctx context.Context, invoker base.Invoker, invocation 
base.Invocation) result.Result {
-       cmdName := fmt.Sprintf("%s&method=%s", invoker.GetURL().Key(), 
invocation.MethodName())
-
-       // Do the configuration if the circuit breaker is created for the first 
time
-       if _, load := f.ifNewMap.LoadOrStore(cmdName, true); !load {
-               configLoadMutex.Lock()
-               filterConf := getConfig(invoker.GetURL().Service(), 
invocation.MethodName(), f.COrP)
-               for _, ptn := range filterConf.Error {
-                       reg, err := regexp.Compile(ptn)
-                       if err != nil {
-                               logger.Warnf("[Hystrix Filter]Errors occurred 
parsing error omit regexp: %s, %v", ptn, err)
-                       } else {
-                               if f.res == nil {
-                                       f.res = 
make(map[string][]*regexp.Regexp)
-                               }
-                               f.res[invocation.MethodName()] = 
append(f.res[invocation.MethodName()], reg)
-                       }
-               }
-               hystrix.ConfigureCommand(cmdName, hystrix.CommandConfig{
-                       Timeout:                filterConf.Timeout,
-                       MaxConcurrentRequests:  
filterConf.MaxConcurrentRequests,
-                       SleepWindow:            filterConf.SleepWindow,
-                       ErrorPercentThreshold:  
filterConf.ErrorPercentThreshold,
-                       RequestVolumeThreshold: 
filterConf.RequestVolumeThreshold,
-               })
-               configLoadMutex.Unlock()
-       }
-       configLoadMutex.RLock()
-       _, _, err := hystrix.GetCircuit(cmdName)
-       configLoadMutex.RUnlock()
-       if err != nil {
-               logger.Errorf("[Hystrix Filter]Errors occurred getting circuit 
for %s , will invoke without hystrix, error is: %+v", cmdName, err)
-               return invoker.Invoke(ctx, invocation)
-       }
-       logger.Infof("[Hystrix Filter]Using hystrix filter: %s", cmdName)
-       var res result.Result
-       _ = hystrix.Do(cmdName, func() error {
-               res = invoker.Invoke(ctx, invocation)
-               err := res.Error()
-               if err != nil {
-                       res.SetError(NewHystrixFilterError(err, false))
-                       for _, reg := range f.res[invocation.MethodName()] {
-                               if reg.MatchString(err.Error()) {
-                                       logger.Debugf("[Hystrix Filter]Error in 
invocation but omitted in circuit breaker: %v; %s", err, cmdName)
-                                       return nil
-                               }
-                       }
-               }
-               return err
-       }, func(err error) error {
-               // Return error and if it is caused by hystrix logic, so that 
it can be handled by previous filters.
-               _, ok := err.(hystrix.CircuitError)
-               logger.Debugf("[Hystrix Filter]Hystrix health check counted, 
error is: %v, failed by hystrix: %v; %s", err, ok, cmdName)
-               res = &result.RPCResult{}
-               res.SetResult(nil)
-               res.SetError(NewHystrixFilterError(err, ok))
-               return err
-       })
-       return res
-}
-
-// OnResponse dummy process, returns the result directly
-func (f *Filter) OnResponse(ctx context.Context, result result.Result, invoker 
base.Invoker, invocation base.Invocation) result.Result {
-       return result
-}
-
-// newFilterConsumer returns Filter instance for consumer
-func newFilterConsumer() filter.Filter {
-       // When first called, load the config in
-       consumerConfigOnce.Do(func() {
-               if err := initConfigConsumer(); err != nil {
-                       logger.Warnf("[Hystrix Filter]ShutdownConfig load 
failed for consumer, error is: %v , will use default", err)
-               }
-       })
-       return &Filter{COrP: true}
-}
-
-// newFilterProvider returns Filter instance for provider
-func newFilterProvider() filter.Filter {
-       providerConfigOnce.Do(func() {
-               if err := initConfigProvider(); err != nil {
-                       logger.Warnf("[Hystrix Filter]ShutdownConfig load 
failed for provider, error is: %v , will use default", err)
-               }
-       })
-       return &Filter{COrP: false}
-}
-
-func getConfig(service string, method string, cOrP bool) 
CommandConfigWithError {
-       // Find method level config
-       var conf *FilterConfig
-       if cOrP {
-               conf = confConsumer
-       } else {
-               conf = confProvider
-       }
-       getConf := conf.Configs[conf.Services[service].Methods[method]]
-       if getConf != nil {
-               logger.Infof("[Hystrix Filter]Found method-level config for %s 
- %s", service, method)
-               return *getConf
-       }
-       // Find service level config
-       getConf = conf.Configs[conf.Services[service].ServiceConfig]
-       if getConf != nil {
-               logger.Infof("[Hystrix Filter]Found service-level config for %s 
- %s", service, method)
-               return *getConf
-       }
-       // Find default config
-       getConf = conf.Configs[conf.Default]
-       if getConf != nil {
-               logger.Infof("[Hystrix Filter]Found global default config for 
%s - %s", service, method)
-               return *getConf
-       }
-       getConf = &CommandConfigWithError{}
-       logger.Infof("[Hystrix Filter]No config found for %s - %s, using 
default", service, method)
-       return *getConf
-}
-
-func initConfigConsumer() error {
-       if config.GetConsumerConfig().FilterConf == nil {
-               return perrors.Errorf("no config for hystrix_consumer")
-       }
-       filterConf := config.GetConsumerConfig().FilterConf
-       var filterConfig any
-       switch reflect.ValueOf(filterConf).Interface().(type) {
-       case map[any]any:
-               filterConfig = 
config.GetConsumerConfig().FilterConf.(map[any]any)[HYSTRIX]
-       case map[string]any:
-               filterConfig = 
config.GetConsumerConfig().FilterConf.(map[string]any)[HYSTRIX]
-       }
-       if filterConfig == nil {
-               return perrors.Errorf("no config for hystrix_consumer")
-       }
-       hystrixConfByte, err := yaml.Marshal(filterConfig)
-       if err != nil {
-               return err
-       }
-       err = yaml.Unmarshal(hystrixConfByte, confConsumer)
-       if err != nil {
-               return err
-       }
-       return nil
-}
-
-func initConfigProvider() error {
-       if config.GetProviderConfig().FilterConf == nil {
-               return perrors.Errorf("no config for hystrix_provider")
-       }
-       filterConfig := 
config.GetProviderConfig().FilterConf.(map[any]any)[HYSTRIX]
-       if filterConfig == nil {
-               return perrors.Errorf("no config for hystrix_provider")
-       }
-       hystrixConfByte, err := yaml.Marshal(filterConfig)
-       if err != nil {
-               return err
-       }
-       err = yaml.Unmarshal(hystrixConfByte, confProvider)
-       if err != nil {
-               return err
-       }
-       return nil
-}
-
-//For sake of dynamic config
-//func RefreshHystrix() error {
-//     conf = &FilterConfig{}
-//     hystrix.Flush()
-//     return initHystrixConfig()
-//}
-
-// CommandConfigWithError describes hystrix command configs with error 
whitelist.
-type CommandConfigWithError struct {
-       Timeout                int      `yaml:"timeout"`
-       MaxConcurrentRequests  int      `yaml:"max_concurrent_requests"`
-       RequestVolumeThreshold int      `yaml:"request_volume_threshold"`
-       SleepWindow            int      `yaml:"sleep_window"`
-       ErrorPercentThreshold  int      `yaml:"error_percent_threshold"`
-       Error                  []string `yaml:"error_whitelist"`
-}
-
-//ShutdownConfig:
-//- Timeout: how long to wait for command to complete, in milliseconds
-//- MaxConcurrentRequests: how many commands of the same type can run at the 
same time
-//- RequestVolumeThreshold: the minimum number of requests needed before a 
circuit can be tripped due to health
-//- SleepWindow: how long, in milliseconds, to wait after a circuit opens 
before testing for recovery
-//- ErrorPercentThreshold: it causes circuits to open once the rolling measure 
of errors exceeds this percent of requests
-//See hystrix doc
-
-// FilterConfig holds hystrix configs at default/service/method levels.
-type FilterConfig struct {
-       Configs  map[string]*CommandConfigWithError
-       Default  string
-       Services map[string]ServiceHystrixConfig
-}
-
-// ServiceHystrixConfig binds service-level and method-level hystrix configs.
-type ServiceHystrixConfig struct {
-       ServiceConfig string `yaml:"service_config"`
-       Methods       map[string]string
-}
diff --git a/filter/hystrix/filter_test.go b/filter/hystrix/filter_test.go
deleted file mode 100644
index 868a93a07..000000000
--- a/filter/hystrix/filter_test.go
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package hystrix
-
-import (
-       "context"
-       "fmt"
-       "regexp"
-       "testing"
-)
-
-import (
-       "github.com/afex/hystrix-go/hystrix"
-
-       "github.com/pkg/errors"
-
-       "github.com/stretchr/testify/assert"
-       "github.com/stretchr/testify/require"
-)
-
-import (
-       "dubbo.apache.org/dubbo-go/v3/common"
-       "dubbo.apache.org/dubbo-go/v3/common/constant"
-       "dubbo.apache.org/dubbo-go/v3/protocol/base"
-       "dubbo.apache.org/dubbo-go/v3/protocol/invocation"
-       "dubbo.apache.org/dubbo-go/v3/protocol/result"
-)
-
-func init() {
-       mockInitHystrixConfig()
-}
-
-func TestNewHystrixFilterError(t *testing.T) {
-       get := NewHystrixFilterError(errors.New("test"), true)
-       assert.True(t, get.(*FilterError).FailByHystrix())
-       assert.Equal(t, "test", get.Error())
-}
-
-func mockInitHystrixConfig() {
-       // Mock config
-       confConsumer = &FilterConfig{
-               make(map[string]*CommandConfigWithError),
-               "Default",
-               make(map[string]ServiceHystrixConfig),
-       }
-       confConsumer.Configs["Default"] = &CommandConfigWithError{
-               Timeout:                1000,
-               MaxConcurrentRequests:  600,
-               RequestVolumeThreshold: 5,
-               SleepWindow:            5000,
-               ErrorPercentThreshold:  5,
-               Error:                  nil,
-       }
-       confConsumer.Configs["userp"] = &CommandConfigWithError{
-               Timeout:                2000,
-               MaxConcurrentRequests:  64,
-               RequestVolumeThreshold: 15,
-               SleepWindow:            4000,
-               ErrorPercentThreshold:  45,
-               Error:                  nil,
-       }
-       confConsumer.Configs["userp_m"] = &CommandConfigWithError{
-               Timeout:                1200,
-               MaxConcurrentRequests:  64,
-               RequestVolumeThreshold: 5,
-               SleepWindow:            6000,
-               ErrorPercentThreshold:  60,
-               Error: []string{
-                       "exception",
-               },
-       }
-       confConsumer.Services["com.ikurento.user.UserProvider"] = 
ServiceHystrixConfig{
-               "userp",
-               map[string]string{
-                       "GetUser": "userp_m",
-               },
-       }
-}
-
-func TestGetHystrixFilter(t *testing.T) {
-       filterGot := newFilterConsumer()
-       assert.NotNil(t, filterGot)
-}
-
-func TestGetConfig1(t *testing.T) {
-       mockInitHystrixConfig()
-       configGot := getConfig("com.ikurento.user.UserProvider", "GetUser", 
true)
-       assert.NotNil(t, configGot)
-       assert.Equal(t, 1200, configGot.Timeout)
-       assert.Equal(t, 64, configGot.MaxConcurrentRequests)
-       assert.Equal(t, 6000, configGot.SleepWindow)
-       assert.Equal(t, 60, configGot.ErrorPercentThreshold)
-       assert.Equal(t, 5, configGot.RequestVolumeThreshold)
-}
-
-func TestGetConfig2(t *testing.T) {
-       mockInitHystrixConfig()
-       configGot := getConfig("com.ikurento.user.UserProvider", "GetUser0", 
true)
-       assert.NotNil(t, configGot)
-       assert.Equal(t, 2000, configGot.Timeout)
-       assert.Equal(t, 64, configGot.MaxConcurrentRequests)
-       assert.Equal(t, 4000, configGot.SleepWindow)
-       assert.Equal(t, 45, configGot.ErrorPercentThreshold)
-       assert.Equal(t, 15, configGot.RequestVolumeThreshold)
-}
-
-func TestGetConfig3(t *testing.T) {
-       mockInitHystrixConfig()
-       // This should use default
-       configGot := getConfig("Mock.Service", "GetMock", true)
-       assert.NotNil(t, configGot)
-       assert.Equal(t, 1000, configGot.Timeout)
-       assert.Equal(t, 600, configGot.MaxConcurrentRequests)
-       assert.Equal(t, 5000, configGot.SleepWindow)
-       assert.Equal(t, 5, configGot.ErrorPercentThreshold)
-       assert.Equal(t, 5, configGot.RequestVolumeThreshold)
-}
-
-type testMockSuccessInvoker struct {
-       base.BaseInvoker
-}
-
-func (iv *testMockSuccessInvoker) Invoke(_ context.Context, _ base.Invocation) 
result.Result {
-       return &result.RPCResult{
-               Rest: "Success",
-               Err:  nil,
-       }
-}
-
-type testMockFailInvoker struct {
-       base.BaseInvoker
-}
-
-func (iv *testMockFailInvoker) Invoke(_ context.Context, _ base.Invocation) 
result.Result {
-       return &result.RPCResult{
-               Err: errors.Errorf("exception"),
-       }
-}
-
-func TestHystrixFilterInvokeSuccess(t *testing.T) {
-       hf := &Filter{}
-       testUrl, err := common.NewURL(
-               fmt.Sprintf("dubbo://%s:%d/com.ikurento.user.UserProvider", 
constant.LocalHostValue, constant.DefaultPort))
-       require.NoError(t, err)
-       testInvoker := testMockSuccessInvoker{*base.NewBaseInvoker(testUrl)}
-       invokeResult := hf.Invoke(context.Background(), &testInvoker, 
&invocation.RPCInvocation{})
-       assert.NotNil(t, invokeResult)
-       require.NoError(t, invokeResult.Error())
-       assert.NotNil(t, invokeResult.Result())
-}
-
-func TestHystrixFilterInvokeFail(t *testing.T) {
-       hf := &Filter{}
-       testUrl, err := common.NewURL(
-               fmt.Sprintf("dubbo://%s:%d/com.ikurento.user.UserProvider", 
constant.LocalHostValue, constant.DefaultPort))
-       require.NoError(t, err)
-       testInvoker := testMockFailInvoker{*base.NewBaseInvoker(testUrl)}
-       invokeResult := hf.Invoke(context.Background(), &testInvoker, 
&invocation.RPCInvocation{})
-       assert.NotNil(t, invokeResult)
-       require.Error(t, invokeResult.Error())
-}
-
-func TestHystrixFilterInvokeCircuitBreak(t *testing.T) {
-       mockInitHystrixConfig()
-       hystrix.Flush()
-       hf := &Filter{COrP: true}
-       resChan := make(chan result.Result, 50)
-       configLoadMutex.Lock()
-       defer configLoadMutex.Unlock()
-       for i := 0; i < 50; i++ {
-               go func() {
-                       testUrl, err := common.NewURL(
-                               
fmt.Sprintf("dubbo://%s:%d/com.ikurento.user.UserProvider", 
constant.LocalHostValue, constant.DefaultPort))
-                       assert.NoError(t, err)
-                       testInvoker := 
testMockSuccessInvoker{*base.NewBaseInvoker(testUrl)}
-                       invokeResult := hf.Invoke(context.Background(), 
&testInvoker, &invocation.RPCInvocation{})
-                       resChan <- invokeResult
-               }()
-       }
-       // This can not always pass the test when on travis due to concurrency, 
you can uncomment the code below and test it locally
-
-       //var lastRest bool
-       //for i := 0; i < 50; i++ {
-       //      lastRest = (<-resChan).Error().(*FilterError).FailByHystrix()
-       //}
-       //Normally the last result should be true, which means the circuit has 
been opened
-       //
-       //assert.True(t, lastRest)
-}
-
-func TestHystrixFilterInvokeCircuitBreakOmitException(t *testing.T) {
-       mockInitHystrixConfig()
-       hystrix.Flush()
-       reg, _ := regexp.Compile(".*exception.*")
-       regs := []*regexp.Regexp{reg}
-       hf := &Filter{res: map[string][]*regexp.Regexp{"": regs}, COrP: true}
-       resChan := make(chan result.Result, 50)
-       configLoadMutex.Lock()
-       defer configLoadMutex.Unlock()
-       for i := 0; i < 50; i++ {
-               go func() {
-                       testUrl, err := common.NewURL(
-                               
fmt.Sprintf("dubbo://%s:%d/com.ikurento.user.UserProvider", 
constant.LocalHostValue, constant.DefaultPort))
-                       assert.NoError(t, err)
-                       testInvoker := 
testMockSuccessInvoker{*base.NewBaseInvoker(testUrl)}
-                       invokeResult := hf.Invoke(context.Background(), 
&testInvoker, &invocation.RPCInvocation{})
-                       resChan <- invokeResult
-               }()
-       }
-       // This can not always pass the test when on travis due to concurrency, 
you can uncomment the code below and test it locally
-
-       //time.Sleep(time.Second * 6)
-       //var lastRest bool
-       //for i := 0; i < 50; i++ {
-       //      lastRest = (<-resChan).Error().(*FilterError).FailByHystrix()
-       //}
-       //
-       //assert.False(t, lastRest)
-}
-
-func TestGetHystrixFilterConsumer(t *testing.T) {
-       get := newFilterConsumer()
-       assert.NotNil(t, get)
-       assert.True(t, get.(*Filter).COrP)
-}
-
-func TestGetHystrixFilterProvider(t *testing.T) {
-       get := newFilterProvider()
-       assert.NotNil(t, get)
-       assert.False(t, get.(*Filter).COrP)
-}
diff --git a/go.mod b/go.mod
index 52f843f50..f86d7c977 100644
--- a/go.mod
+++ b/go.mod
@@ -5,7 +5,6 @@ go 1.25.0
 require (
        github.com/RoaringBitmap/roaring v1.2.3
        github.com/Workiva/go-datastructures v1.0.52
-       github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5
        github.com/alibaba/sentinel-golang v1.0.4
        github.com/apache/dubbo-getty v1.4.10
        github.com/apache/dubbo-go-hessian2 v1.12.5
diff --git a/go.sum b/go.sum
index 7e5807cb5..5cc844e15 100644
--- a/go.sum
+++ b/go.sum
@@ -52,7 +52,6 @@ github.com/StackExchange/wmi 
v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrU
 github.com/VividCortex/gohistogram v1.0.0/go.mod 
h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g=
 github.com/Workiva/go-datastructures v1.0.52 
h1:PLSK6pwn8mYdaoaCZEMsXBpBotr4HHn9abU0yMQt0NI=
 github.com/Workiva/go-datastructures v1.0.52/go.mod 
h1:Z+F2Rca0qCsVYDS8z7bAGm8f3UkzuWYS/oBZz5a7VVA=
-github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 
h1:rFw4nCn9iMW+Vajsk51NtYIcwSTkXr+JGrMd36kTDJw=
 github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod 
h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c=
 github.com/agiledragon/gomonkey v2.0.2+incompatible 
h1:eXKi9/piiC3cjJD1658mEE2o3NjkJ5vDLgYjCQu0Xlw=
 github.com/agiledragon/gomonkey v2.0.2+incompatible/go.mod 
h1:2NGfXu1a80LLr2cmWXGBDaHEjb1idR6+FVlX5T3D9hw=
diff --git a/imports/imports.go b/imports/imports.go
index 4044f70dc..fc703f2f3 100644
--- a/imports/imports.go
+++ b/imports/imports.go
@@ -51,7 +51,6 @@ import (
        _ "dubbo.apache.org/dubbo-go/v3/filter/exec_limit"
        _ "dubbo.apache.org/dubbo-go/v3/filter/generic"
        _ "dubbo.apache.org/dubbo-go/v3/filter/graceful_shutdown"
-       _ "dubbo.apache.org/dubbo-go/v3/filter/hystrix"
        _ "dubbo.apache.org/dubbo-go/v3/filter/metrics"
        _ "dubbo.apache.org/dubbo-go/v3/filter/otel/trace"
        _ "dubbo.apache.org/dubbo-go/v3/filter/polaris/limit"
diff --git a/server/options.go b/server/options.go
index e04e1af65..d31351d0e 100644
--- a/server/options.go
+++ b/server/options.go
@@ -393,14 +393,6 @@ func WithServerProtocol(opts ...protocol.ServerOption) 
ServerOption {
        }
 }
 
-// todo(DMwangnima): this configuration would be used by filter/hystrix
-// think about a more ideal way to configure
-func WithServerFilterConf(conf any) ServerOption {
-       return func(opts *ServerOptions) {
-               opts.Provider.FilterConf = conf
-       }
-}
-
 func WithServerAdaptiveService() ServerOption {
        return func(opts *ServerOptions) {
                opts.Provider.AdaptiveService = true
diff --git a/server/options_test.go b/server/options_test.go
index 85560cbb5..e0005a4dc 100644
--- a/server/options_test.go
+++ b/server/options_test.go
@@ -1020,15 +1020,6 @@ func TestWithServerProtocol(t *testing.T) {
        assert.Equal(t, "dubbo", opts.Protocols["test-protocol"].Name)
 }
 
-// Test WithServerFilterConf
-func TestWithServerFilterConf(t *testing.T) {
-       opts := defaultServerOptions()
-       conf := map[string]any{"key": "value"}
-       opt := WithServerFilterConf(conf)
-       opt(opts)
-       assert.Equal(t, conf, opts.Provider.FilterConf)
-}
-
 // Test WithServerTLSOption
 func TestWithServerTLSOption(t *testing.T) {
        opts := defaultServerOptions()
diff --git a/tools/dubbogo-cli/cmd/testGenCode/template/newApp/go.mod 
b/tools/dubbogo-cli/cmd/testGenCode/template/newApp/go.mod
index 0d6e4e45d..7d288d4ae 100644
--- a/tools/dubbogo-cli/cmd/testGenCode/template/newApp/go.mod
+++ b/tools/dubbogo-cli/cmd/testGenCode/template/newApp/go.mod
@@ -14,7 +14,6 @@ require (
        github.com/RoaringBitmap/roaring v0.7.1 // indirect
        github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // 
indirect
        github.com/Workiva/go-datastructures v1.0.52 // indirect
-       github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 // 
indirect
        github.com/alibaba/sentinel-golang v1.0.4 // indirect
        github.com/aliyun/alibaba-cloud-sdk-go v1.61.18 // indirect
        github.com/apache/dubbo-getty v1.4.7 // indirect
diff --git a/tools/dubbogo-cli/cmd/testGenCode/template/newDemo/go.mod 
b/tools/dubbogo-cli/cmd/testGenCode/template/newDemo/go.mod
index a12c32f0a..9b0498674 100644
--- a/tools/dubbogo-cli/cmd/testGenCode/template/newDemo/go.mod
+++ b/tools/dubbogo-cli/cmd/testGenCode/template/newDemo/go.mod
@@ -14,7 +14,6 @@ require (
        github.com/RoaringBitmap/roaring v0.7.1 // indirect
        github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // 
indirect
        github.com/Workiva/go-datastructures v1.0.52 // indirect
-       github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 // 
indirect
        github.com/alibaba/sentinel-golang v1.0.4 // indirect
        github.com/aliyun/alibaba-cloud-sdk-go v1.61.18 // indirect
        github.com/apache/dubbo-getty v1.4.7 // indirect
diff --git a/tools/dubbogo-cli/generator/application/gomod.go 
b/tools/dubbogo-cli/generator/application/gomod.go
index 7fdae609c..753b05994 100644
--- a/tools/dubbogo-cli/generator/application/gomod.go
+++ b/tools/dubbogo-cli/generator/application/gomod.go
@@ -34,7 +34,6 @@ require (
        github.com/RoaringBitmap/roaring v0.7.1 // indirect
        github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // 
indirect
        github.com/Workiva/go-datastructures v1.0.52 // indirect
-       github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 // 
indirect
        github.com/alibaba/sentinel-golang v1.0.4 // indirect
        github.com/aliyun/alibaba-cloud-sdk-go v1.61.18 // indirect
        github.com/apache/dubbo-getty v1.4.7 // indirect
diff --git a/tools/dubbogo-cli/generator/sample/mod.go 
b/tools/dubbogo-cli/generator/sample/mod.go
index 7f2f1038e..950765795 100644
--- a/tools/dubbogo-cli/generator/sample/mod.go
+++ b/tools/dubbogo-cli/generator/sample/mod.go
@@ -34,7 +34,6 @@ require (
        github.com/RoaringBitmap/roaring v0.7.1 // indirect
        github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // 
indirect
        github.com/Workiva/go-datastructures v1.0.52 // indirect
-       github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 // 
indirect
        github.com/alibaba/sentinel-golang v1.0.4 // indirect
        github.com/aliyun/alibaba-cloud-sdk-go v1.61.18 // indirect
        github.com/apache/dubbo-getty v1.4.7 // indirect

Reply via email to