erlang / otp

Erlang/OTP
http://erlang.org
Apache License 2.0
11.39k stars 2.95k forks source link

[socket_closed_remotely] Reproduce httpc error #8841

Open viplifes opened 1 month ago

viplifes commented 1 month ago

Describe the bug Erlang httpc client under high loads can sometimes work with an error socket_closed_remotely. I made an example to reproduce this error in docker compose. In example, you can switch httpc to hackney. httpc will return frequent socket_closed_remotely, while hackney always works successfully. The error is reproduced in different versions of Erlang 24/25/26/27

The error is somehow related to the number of parallel requests, the size of the request body and the size of the response body.

To Reproduce https://github.com/viplifes/socket_closed_remotely docker compose up --build

Expected behavior No errors httpc

Affected versions Erlang 24/25/26/27

Additional context https://github.com/viplifes/socket_closed_remotely

viplifes commented 1 month ago

Similar problem https://github.com/erlang/otp/issues/7620