[erlang-questions] inets HTTP client does not persist connections when POSTing

Edwin Fine erlang-questions_efine@REDACTED
Mon Aug 4 16:18:54 CEST 2008

Thanks, Ingela, I look forward to seeing the modifications. Hopefully you
can post a patch so I don't have to wait for the next Erlang release.


On Mon, Aug 4, 2008 at 4:47 AM, Ingela Anderton Andin <
ingela@REDACTED> wrote:

> Hi Edward, a quick look at the HTTP-spec makes me believe you got a
> valid point.
> The current http client has gradually evolved from a user contribution
> and in the processes
> you may say it was totally rewritten, and we may have missed an aspect
> here. (E.i. only used
> persistent connections for pipelined requests). But I do not
> have all details about this fresh in my memory as this was some time
> ago. We will have to take
> deeper look into this.  I have put it on the todo-list.  There are a few
> things that has
> higer priority right now but i hope we can deal with this issue fairly
> soon.
> Regards  Ingela- Erlang/OTP, Ericsson
> > I am using the inets HTTP client to POST many requests to the same URL. I
> am
> > finding that even though keep-alive is set, and persistent connections
> are
> > the default for HTTP 1.1 (which is what I am using), the inets HTTP
> client
> > is opening a new connection for every http:request(post,...) I send. I
> > verified this by using Wireshark to monitor the TCP/IP traffic. When
> there
> > is a lot of activity involving multiple clients, this causes ephemeral
> port
> > exhaustion because of the infamous TIME_WAIT problem. I have already
> reduced
> > the TCP wait time to 30 seconds and don't want to reduce it more.
> >
> > I read the inets code, and if I understand it correctly, it seems that
> when
> > a non-idempotent operation such as POST is performed, httpc does not
> reuse
> > the existing connection (httpc_manager:select_session/4 returns
> > no_connection, which starts a new handler). I am not sure if this is the
> > correct thing to do, because my understanding is that the restriction on
> > non-idempotent operations applies to pipelining, not persistent
> connections.
> > I can see no reason why one should not be able to do a series of
> consecutive
> > POSTs on the same socket, as long as one waits for a reply before posting
> > the next request.
> >
> > I'm not sure if this is a bug, a feature, or my misunderstanding, so I am
> > posting to this mailing list in the hope that someone, whose name may or
> may
> > not be Ingela, can enlighten me and perhaps suggest how I can use inets
> to
> > do multiple sequential POSTs on a persistent connection.
> >
> > I'm using OTP R12B-3 on Ubuntu Linux 8.04. The http:request call uses all
> > default HTTP and TCP/IP options (i.e. empty lists).
> >
> > Regards,
> > Edwin Fine
> >
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions

For every expert there is an equal and opposite expert - Arthur C. Clarke
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080804/87177fc5/attachment.htm>

More information about the erlang-questions mailing list