git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [BUG?] git http connection reuse

From
Jeff King <peff@peff.net>
Date
Feb 18, 2014, 07:55 UTC
Message-ID
<20140218075534.GB29804@sigill.intra.peff.net>
In-Reply-To
<alpine.DEB.2.00.1402180806070.15465@tvnag.unkk.fr>
On Tue, Feb 18, 2014 at 08:13:16AM +0100, Daniel Stenberg wrote:
Show 9 quoted lines
> >Right; I'd expect multiple connections for parallel requests, but
> >in this case we are completing the first and removing the handle
> >before starting the second. Digging further, I was able to
> >reproduce the behavior with a simple program:
> 
> Yeah, given your description I had no problems to repeat it either.
> Turns out we had no decent test case that checked for this so in our
> eagerness to fix a security problem involving "over-reuse" we broke
> this simpler reuse case. Two steps forward, one step backward... :-/
You are talking about the NTLM fix here, right?

I think there is still an unrelated issue with curl_multi preventing connection reuse, but I'm not sure from what you say below...

Show 7 quoted lines
> >Does that apply to the handle after it has finished its transaction
> >and been removed from the multi object (in which case git is Doing
> >It Wrong)?
> 
> No it doesn't. The man page should probably be clarified to express
> that slightly better. It just means that _while_ a handle is added to
> a multi handle it cannot be used with curl_easy_perform().

Thanks for the clarification. That was my guess from reading it, but given that it wasn't working as expected, I wondered if we were violating the rules. I saw the documentation fix you just pushed; it looks reasonable to me.

Show 5 quoted lines
> Several internal caches are kept in the multi handle when that's used
> though, so when getting the easy handle out after having used it with
> the multi interface and then using it with the easy interface may
> cause libcurl to do a little more work than if you would be able to
> re-add it to the same multi handle do to the operation with that...

I'm not clear whether you mean by this that it is _expected_ in my test program for curl not to reuse the connection. Or that curl may simply have to do a little more work, and it is still a bug that the connection is not reused.

We can certainly teach git to use the multi interface, even when doing a single blocking request.

-Peff
Previous: Daniel StenbergNext: Daniel Stenberg
Message 8 of 11 in “[BUG?] git http connection reuse”
  1. Jeff KingFeb 16, 2014
  2. Kyle J. McKayFeb 16, 2014
  3. Daniel StenbergFeb 16, 2014
  4. Daniel StenbergFeb 16, 2014
  5. Jeff KingFeb 17, 2014
  6. Jeff KingFeb 17, 2014
  7. Daniel StenbergFeb 18, 2014
  8. Jeff KingFeb 18, 2014
  9. Daniel StenbergFeb 18, 2014
  10. Daniel StenbergFeb 18, 2014
  11. http: never use curl_easy_performJeff King, Feb 18, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.