Skip to content

panic: WriteHeader called after Handler finished #13

@kwzcoder

Description

@kwzcoder

部署在云服务器上会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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions