如果我在客户端取消正在进行的HTTP请求,为什么我的Go服务器应用程序会退出

I'm working on a http server using Go.

However I have this weird issue that I don't understand.

When I cancel an ongoing HTTP request on the client (I use Insomnia) side, the server will exit with logs like this:

2017/05/15 11:25:24 context canceled

Process finished with exit code 1

Can someone help me explain why the server exits itself ?

I use pressly/chi to implement my http handlers.

I figured it out.

Apparently, in one place, I call log.Fatalf() when there's an error, causing the app to exit when the context canceled.

Furthermore, my lack of understanding of how context cancelling works makes it difficult to make debug the problem.