4

I have a HTTP client(fasthttp) and a HTTP server(gin). When sending big POST request(Content-Length 70K-100K, Content-Type: application/json), sometimes the client encounters error "write: broken pipe".

With ngrep, I found the server returns TCP RST to the client. There is not any error log on the server side. And sometimes it works well with no error.

What is the problem? What can I do to prevent this?

jianfyun
  • 71
  • 1
  • 4
  • Can you try that with a client using standard http library? There were bugs in fasthttp that makes it racy. – Burak Serdar Oct 23 '19 at 04:40
  • 5
    Broken pipe is the result of the server closing the connection before the client has sent all data. Check your server for why it is closing the connection. This might be for example if the request requires proper authentication which the client does not have and thus the server closes the connection immediately after it realizes this. It might also that the server sends a response based on the unfinished request and then closes but the client does not read the response but continues to write. – Steffen Ullrich Oct 23 '19 at 06:09

0 Answers0