Go 戈朗';s hystrix图书馆“;“电路断路”;没有「;超时“;错误
我们在golang应用程序中使用hystrix,在这里我们得到了hystrix:电路开路错误,即使没有hystrix:超时 hystrix配置: 在hystrix回退部分中,我们记录错误消息信息。我们可以清楚地看到,我们只有hystrix:电路开路错误,没有任何其他错误 有时它的行为非常随机,在下图中我们可以看到,在hystrix:timeout和hystrix:circuit open之间没有相关性 sudo/样本hystrix代码:Go 戈朗';s hystrix图书馆“;“电路断路”;没有「;超时“;错误,go,hystrix,netflix,fault-tolerance,Go,Hystrix,Netflix,Fault Tolerance,我们在golang应用程序中使用hystrix,在这里我们得到了hystrix:电路开路错误,即使没有hystrix:超时 hystrix配置: 在hystrix回退部分中,我们记录错误消息信息。我们可以清楚地看到,我们只有hystrix:电路开路错误,没有任何其他错误 有时它的行为非常随机,在下图中我们可以看到,在hystrix:timeout和hystrix:circuit open之间没有相关性 sudo/样本hystrix代码: 是否有人遇到此错误以及如何修复此错误?可能是由于默认设
是否有人遇到此错误以及如何修复此错误?可能是由于默认设置为20的
requestVolumeThreshold
根据hystrix golang客户提供的文件
// DefaultVolumeThreshold is the minimum number of requests needed before a circuit can be tripped due to health
DefaultVolumeThreshold = 20
你可以用
// Settings returns the hystrix command config
func (c Config) Settings() hystrix.CommandConfig {
return hystrix.CommandConfig{
Timeout: 8000,
RequestVolumeThreshold: 1000, // FIXME: all calls must be paginated
}
}
将其调整为大于默认值的某个数字修复了我的错误
// DefaultVolumeThreshold is the minimum number of requests needed before a circuit can be tripped due to health
DefaultVolumeThreshold = 20
// Settings returns the hystrix command config
func (c Config) Settings() hystrix.CommandConfig {
return hystrix.CommandConfig{
Timeout: 8000,
RequestVolumeThreshold: 1000, // FIXME: all calls must be paginated
}
}