From 05e95155a10fab3d3c495076e51b2ce79fa26cf3 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Sun, 8 Sep 2013 05:01:31 -0400 Subject: upload-pack: send keepalive packets during pack computation When upload-pack has started pack-objects, there may be a quiet period while pack-objects prepares the pack (i.e., counting objects and delta compression). Normally we would see (and send to the client) progress information, but if "--quiet" is in effect, pack-objects will produce nothing at all until the pack data is ready. On a large repository, this can take tens of seconds (or even minutes if the system is loaded or the repository is badly packed). Clients or intermediate proxies can sometimes give up in this situation, assuming that the server or connection has hung. This patch introduces a "keepalive" option; if upload-pack sees no data from pack-objects for a certain number of seconds, it will send an empty sideband data packet to let the other side know that we are still working on it. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- Documentation/config.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Documentation') diff --git a/Documentation/config.txt b/Documentation/config.txt index 6e53fc5074..432c38c3f2 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -2164,6 +2164,17 @@ uploadpack.allowtipsha1inwant:: of a hidden ref (by default, such a request is rejected). see also `uploadpack.hiderefs`. +uploadpack.keepalive:: + When `upload-pack` has started `pack-objects`, there may be a + quiet period while `pack-objects` prepares the pack. Normally + it would output progress information, but if `--quiet` was used + for the fetch, `pack-objects` will output nothing at all until + the pack data begins. Some clients and networks may consider + the server to be hung and give up. Setting this option instructs + `upload-pack` to send an empty keepalive packet every + `uploadpack.keepalive` seconds. Setting this option to 0 + disables keepalive packets entirely. The default is 0. + url..insteadOf:: Any URL that starts with this value will be rewritten to start, instead, with . In cases where some site serves a -- cgit v1.2.3 From 115dedd72223e101181363f4e6053b4c937fdc37 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Sun, 8 Sep 2013 05:02:06 -0400 Subject: upload-pack: bump keepalive default to 5 seconds There is no reason not to turn on keepalives by default. They take very little bandwidth, and significantly less than the progress reporting they are replacing. And in the case that progress reporting is on, we should never need to send a keepalive anyway, as we will constantly be showing progress and resetting the keepalive timer. We do not necessarily know what the client's idea of a reasonable timeout is, so let's keep this on the low side of 5 seconds. That is high enough that we will always prefer our normal 1-second progress reports to sending a keepalive packet, but low enough that no sane client should consider the connection hung. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- Documentation/config.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/config.txt b/Documentation/config.txt index 432c38c3f2..3fc08293b7 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -2173,7 +2173,7 @@ uploadpack.keepalive:: the server to be hung and give up. Setting this option instructs `upload-pack` to send an empty keepalive packet every `uploadpack.keepalive` seconds. Setting this option to 0 - disables keepalive packets entirely. The default is 0. + disables keepalive packets entirely. The default is 5 seconds. url..insteadOf:: Any URL that starts with this value will be rewritten to -- cgit v1.2.3