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

Re: [bug] user may be cornered into delete files #9901

From
Jeff King <peff@peff.net>
Date
Nov 15, 2024, 09:32 UTC
Message-ID
<20241115093214.GA1749331@coredump.intra.peff.net>
In-Reply-To
<ZzaJzm4kyYbcDSgm@tapette.crustytoothpaste.net>
On Thu, Nov 14, 2024 at 11:37:50PM +0000, brian m. carlson wrote:
Show 7 quoted lines
> The only thing which might potentially be a problem on the Git side is
> that I don't know if we try to hold the connection open without sending
> a sideband during pack generation, in which case if the client side
> doesn't send anything at all, then the connection might be closed by the
> server.  I'll point out that GitHub sends SSH keepalives, so typically
> the connection should not be reset unless the connection actually
> drops.

Yes, we'll hold the connection open for git-over-ssh. We can't generate the pack until we've seen what the other side advertises, and it's probably too heavy-weight to start a second ssh connection. Even with ssh keepalives, I would not be surprised if the process terminating the Git-level protocol conversation on the server side had some internal timeouts.

There are Git-level keepalives during the similar compression operation of a clone/fetch, as well as the delta resolution for the server side of a push. But there's nothing during the client-side compression.

I know we've discussed this on the list before, but I couldn't find anything substantive, and certainly not patches. I think it would _probably_ work for the client to send 0-length pktlines (actual "0004", not "0000" flushes) every few seconds while it's waiting. But it would be the first time we've done so from the client side, and the first time we've done it outside of sideband framing. So it's possible a server might not like it (in which case we'd probably need a new protocol extension).

> Overall, I would not say this is a bug in Git.  Pushing over HTTPS may
> help you get your pushes working in a more robust way, but in general,
> I'd recommend storing the data in your repository differently.

I agree with everything you said, but I wanted to add one more workaround: running "git gc" locally will pack all of those objects into a single pack. And then the subsequent push should be fast, because we'll already have done the delta search.

-Peff
Previous: brian m. carlsonNext: A bughunter
Message 5 of 7 in “[bug] user may be cornered into delete files #9901”
  1. A bughunterNov 14, 2024
  2. Fw: [bug] user may be cornered into delete files #9901A bughunter, Nov 14, 2024
  3. Fw: [bug] user may be cornered into delete files #9901A bughunter, Nov 14, 2024
  4. brian m. carlsonNov 14, 2024
  5. Jeff KingNov 15, 2024
  6. Fw: Re: [bug] user may be cornered into delete files #9901A bughunter, Nov 15, 2024
  7. A bughunterNov 18, 2024

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.