microservices icon indicating copy to clipboard operation
microservices copied to clipboard

panic: WriteHeader called after Handler finished

Open kwzcoder opened this issue 4 years ago • 0 comments

部署在云服务器上会panic: WriteHeader called after Handler finished

micro Api panic 必现步骤 : 1. 先把熔断阀值调高 hystrix.DefaultMaxConcurrent = 100000 hystrix.DefaultVolumeThreshold = 100000 2. 熔断超时调低 hystrix.DefaultTimeout = 100 3 .用压测工具 webbench 高并发请求接口必panic "panic: net/http: CloseNotify called after ServeHTTP finished"
在这之前想请教下 Demo里面 user-api里超时设置 hystrix.DefaultTimeout = 5000 , 但是我在breaker/hystrix.go打印依然是默认的1000, 在api/user/main.go设置是不是没有生效? 所以上述的步骤里面几句代码是加在了, breaker/hystrix.go init()函数里面 image

image

image

kwzcoder avatar Mar 11 '20 10:03 kwzcoder