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

Re: [PATCH] Fix potential local deadlock during fetch-pack

From
Erik Faye-Lund <kusmabite@gmail.com>
Date
Mar 30, 2011, 09:50 UTC
Message-ID
<AANLkTinyok+UnR8pOpp43v5EHEN8_YDCC0MFcBfC1LRY@mail.gmail.com>
In-Reply-To
<AANLkTikCRRftjExdhMgFGFMy-Dc1UCMdW1nTYV2bK1-T@mail.gmail.com>
On Wed, Mar 30, 2011 at 11:42 AM, Erik Faye-Lund <kusmabite@gmail.com> wrote:
Show 12 quoted lines
> On Tue, Mar 29, 2011 at 7:06 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> The fetch-pack/upload-pack protocol relies on the underlying transport
>> (local pipe or TCP socket) to have enough slack to allow one window worth
>> of data in flight without blocking the writer.  Traditionally we always
>> relied on being able to have a batch of 32 "have"s in flight (roughly 1.5k
>> bytes) to stream.
>>
>
> Hmm, this explanation makes me wonder: Could this be related to the
> deadlock we're experiencing with git-push over the git-protocol on
> Windows when side-band-64k is enabled?
>

No, It doesn't seem like that's it. The socket buffers appears to be 8k by default on Windows, which should be plenty, right?

---8<---
diff --git a/compat/mingw.c b/compat/mingw.c
index d527562..985c271 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -1404,7 +1404,7 @@ int mingw_getnameinfo(const struct sockaddr *sa,
socklen_t salen,

 int mingw_socket(int domain, int type, int protocol)
 {
-	int sockfd;
+	int sockfd, val, len;
 	SOCKET s;

 	ensure_socket_initialization();
@@ -1428,6 +1428,12 @@ int mingw_socket(int domain, int type, int protocol)
 		return error("unable to make a socket file descriptor: %s",
 			strerror(errno));
 	}
+
+	len = sizeof(val);
+	if (!getsockopt(s, SOL_SOCKET, SO_RCVBUF, (char *)&val, &len))
+		fprintf(stderr, "SO_RCVBUF: %d\n", val);
+	len = sizeof(val);
+	if (!getsockopt(s, SOL_SOCKET, SO_SNDBUF, (char *)&val, &len))
+		fprintf(stderr, "SO_SNDBUF: %d\n", val);
 	return sockfd;
 }

---8<---

$ git push git://localhost
SO_RCVBUF: 8192
SO_SNDBUF: 8192
...
Previous: Erik Faye-LundNext: Shawn Pearce
Message 5 of 6 in “Fix potential local deadlock during fetch-pack”
  1. Fix potential local deadlock during fetch-packJunio C Hamano, Mar 29, 2011
  2. Shawn PearceMar 29, 2011
  3. Shawn PearceMar 29, 2011
  4. Erik Faye-LundMar 30, 2011
  5. Erik Faye-LundMar 30, 2011
  6. Shawn PearceMar 31, 2011

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.