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

[PATCH] connected: close err_fd in promisor fast-path

From
EGEthan via GitGitGadget <gitgitgadget@gmail.com>
Date
May 15, 2026, 06:39 UTC
Message-ID
<pull.2303.git.git.1778827194448.gitgitgadget@gmail.com>
From: Ethan Dickson <ethanndickson@gmail.com>

connected.h documents that err_fd is closed before check_connected() returns. It is, on three of four exit paths. The promisor-pack fast path added in 50033772d (connected: verify promisor-ness of partial clone, 2020-01-30) returns 0 without closing it.

receive-pack uses err_fd as the write end of an async sideband muxer's pipe, and the muxer thread waits for EOF. The same omission has caused deadlocks there twice before: 49ecfa13f (receive-pack: close sideband fd on early pack errors, 2013-04-19) and 6cdad1f13 (receive-pack: fix deadlock when we cannot create tmpdir, 2017-03-07).

Signed-off-by: Ethan Dickson <ethanndickson@gmail.com>
---
    connected: close err_fd in promisor fast-path
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2303%2Fethanndickson%2Fconnected-close-err-fd-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2303/ethanndickson/connected-close-err-fd-v1
Pull-Request: https://github.com/git/git/pull/2303
 connected.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/connected.c b/connected.c
index 6718503649..7e26976832 100644
--- a/connected.c
+++ b/connected.c
@@ -76,6 +76,8 @@ int check_connected(oid_iterate_fn fn, void *cb_data,
 promisor_pack_found:
 			;
 		} while ((oid = fn(cb_data)) != NULL);
+		if (opt->err_fd)
+			close(opt->err_fd);
 		return 0;
 	}
 

base-commit: 94f057755b7941b321fd11fec1b2e3ca5313a4e0
-- 
gitgitgadget
Message 1 of 1 in “connected: close err_fd in promisor fast-path”
  1. connected: close err_fd in promisor fast-pathEthan via GitGitGadget, May 15, 2026

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.