<div dir="ltr">Duplicate requests will be sent when you have already run a request against the same host and therefor have an existing keep-alive connection open. If you then perform a request where the request body takes more than five seconds to send a second identical request will be sent concurrently.<div><br></div><div>I think I have figured what is happening after tracing httpc.<br><div><br></div><div>The code reaches <a href="https://github.com/erlang/otp/blob/ec8e9a96bd0d0148df5008b0665da0725e5b3f92/lib/inets/src/http_client/httpc_manager.erl#L851" target="_blank">https://github.com/erlang/otp/blob/ec8e9a96bd0d0148df5008b0665da0725e5b3f92/lib/inets/src/http_client/httpc_manager.erl#L851</a> and calls `httpc_handler:send` which blocks while sending the request. If the request body takes longer than five seconds to send the `gen_server:call` will timeout and reach this code <a href="https://github.com/erlang/otp/blob/ec8e9a96bd0d0148df5008b0665da0725e5b3f92/lib/inets/src/http_client/httpc_manager.erl#L856" target="_blank">https://github.com/erlang/otp/blob/ec8e9a96bd0d0148df5008b0665da0725e5b3f92/lib/inets/src/http_client/httpc_manager.erl#L856</a>. `start_handler` will create a new connection sending another identical request even though a request is already in progress.</div><div><br></div><div>I would be happy to provide a patch after some guidance on what the fix should be. Maybe the `handle_call` in `httpc_handler` should return immediately and the request be sent without blocking the caller?<br clear="all"><div><br></div>-- <br><div>Eric Meadows-Jönsson</div>
</div></div></div>