Kevin Wan

Results 348 comments of Kevin Wan
trafficstars

Thanks for your contribution! But this is a breaking change. And please add unit tests.

Merge this PR later. Let's figure out if it's possible to fix the problem with the same method `NewWriter`. Would you please give a simple example to reproduce the problem?

Would you please give a runnable demo to reproduce the problem? Thanks!

I use the following code, didn't reproduce this problem. ```go func main() { flag.Parse() var c config.Config conf.MustLoad(*configFile, &c) group := service.NewServiceGroup() gw := gateway.MustNewServer(c.Gateway) group.Add(gw) ctx := svc.NewServiceContext(c) s...

Thanks for your demo code! I found that in zrpc, when we use `server.GracefulStop()`, it blocks. While using `server.Stop()` works. I'm digging into it.

Still working on it. Get back to you when I have more progress.

> @kevwan Any update? Thx I've tested with your demo. Please have a try as well.

`context canceled` means clients closed the requests. Typically, the scenario is the user closes the browser window before the server responds.

Check the code here. https://github.com/zeromicro/go-zero/blob/896e1a2abb09254ec37952869e40b2eeee5f0200/core/discov/publisher.go#L149

You can define your middleware to handle panics. I think it meets your requirements. Use `svr.Use(..)`.