[BUG] clone of large repo fails when server closes idle SSH session during "Resolving deltas"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Git's handling of the SSH session during "git clone" changed between Git
2.17.0 and 2.31.1, causing cloning of a large repo to fail when the server
closes the idle session during the "Resolving deltas" phase.

In the older version, git closes the SSH session after "Receiving objects"
and before "Resolving deltas". In the newer version, git doesn't close the
SSH session until after "Resolving deltas" finishes. In the newer version,
if "Resolving deltas" takes a long time (over 2 minutes for our large 
repo)
and the server closes the idle SSH session (60 seconds for our GitHub
Enterprise server), git displays the error message "Connection to
git.example.com closed by remote host", finishes resolving deltas, then 
exits
without checking out files.

Successful with Git 2.17.0:

> git clone git@xxxxxxxxxxxxxxx:org/bigrepo.git
Cloning into 'bigrepo'...
remote: Enumerating objects: 260, done.
remote: Counting objects: 100% (260/260), done.
remote: Compressing objects: 100% (170/170), done.
remote: Total 361839 (delta 74), reused 174 (delta 37), pack-reused 361579
Receiving objects: 100% (361839/361839), 4.47 GiB | 36.71 MiB/s, done.
Resolving deltas: 100% (252249/252249), done.
Checking out files: 100% (59466/59466), done.

Fails with Git 2.31.1:

git clone git@xxxxxxxxxxxxxxx:org/bigrepo.git
Cloning into 'bigrepo'...
remote: Enumerating objects: 363, done.
remote: Counting objects: 100% (363/363), done.
remote: Compressing objects: 100% (221/221), done.
Receiving objects: 100% (361930/361930), 4.47 GiB | 36.37 MiB/s, done.
RConnection to git.example.com closed by remote host.esolving deltas:  39% 
(98729/252244)
Resolving deltas: 100% (252244/252244), done.

What did you do before the bug happened? (Steps to reproduce your issue)

Ran "git clone git@xxxxxxxxxxxxxxx:org/bigrepo.git"

What did you expect to happen? (Expected behavior)

Expected successful creation of a cloned repo.

What happened instead? (Actual behavior)

Repo was partially created, but files were not checked out. Branches and 
tags
also seem to be missing from the repo.

What's different between what you expected and what actually happened?

With the old Git version, cloning the repo is successful. With the newer
version it fails.

Anything else you want to add:

A workaround is to configure the SSH client to prevent the server from
seeing an idle session, by adding these lines to .ssh/config:

Host git.example.com
    # Send keep-alive message to server every 30 seconds
    # so the server won't close an idle session.
    ServerAliveInterval 30


[System Info]
git version:
git version 2.31.1.windows.1
cpu: x86_64
built from commit: c5f0be26a7e3846e3b6268d1c6c4800d838c6bbb
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
uname: Windows 10.0 14393
compiler info: gnuc: 10.2
libc info: no libc information available
$SHELL (typically, interactive shell): <unset>


[Enabled Hooks]
not run from a git repository - no hooks to show




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux