git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* (Mosty harmless) protocol error when pushing
@ 2010-05-25  6:51 Björn Gustavsson
  2010-05-25  7:28 ` Jeff King
  0 siblings, 1 reply; 5+ messages in thread
From: Björn Gustavsson @ 2010-05-25  6:51 UTC (permalink / raw)
  To: git@vger.kernel.org"

I am not sure whether this has been reported before.
I follow this mailing list, but I don't read all emails in
detail, so I could have missed a bug report or a fix
for the problem.

Anyway, what seems to happen is that some protocol
error happens when an automatic GC is triggered
during a push. The push succeeded, despite the
error messages.

My version of git is 1.7.1.86.g0e460. Here is
what happened (I force-pushed a single branch):

Counting objects: 270, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (71/71), done.
Writing objects: 100% (184/184), 151.33 KiB, done.
Total 184 (delta 157), reused 134 (delta 113)
Auto packing the repository for optimum performance.
fatal: protocol error: bad line length character: Remo
error: error in sideband demultiplexer
To git@github.com:bjorng/otp.git
 + 7651a63...874192d bg/nif_error -> bg/nif_error (forced update)
error: failed to push some refs to 'git@github.com:bjorng/otp.git'

-- 
Björn Gustavsson, Erlang/OTP, Ericsson AB

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: (Mosty harmless) protocol error when pushing
  2010-05-25  6:51 (Mosty harmless) protocol error when pushing Björn Gustavsson
@ 2010-05-25  7:28 ` Jeff King
  2010-05-26  5:58   ` Björn Gustavsson
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff King @ 2010-05-25  7:28 UTC (permalink / raw)
  To: Björn Gustavsson; +Cc: git@vger.kernel.org

On Tue, May 25, 2010 at 08:51:34AM +0200, Björn Gustavsson wrote:

> I am not sure whether this has been reported before.
> I follow this mailing list, but I don't read all emails in
> detail, so I could have missed a bug report or a fix
> for the problem.

I haven't seen it before, and I do read most of the emails (OK, I skip
some of the boring ones. :) ).

> Counting objects: 270, done.
> Delta compression using up to 8 threads.
> Compressing objects: 100% (71/71), done.
> Writing objects: 100% (184/184), 151.33 KiB, done.
> Total 184 (delta 157), reused 134 (delta 113)
> Auto packing the repository for optimum performance.
> fatal: protocol error: bad line length character: Remo
> error: error in sideband demultiplexer
> To git@github.com:bjorng/otp.git
>  + 7651a63...874192d bg/nif_error -> bg/nif_error (forced update)
> error: failed to push some refs to 'git@github.com:bjorng/otp.git'

I wasn't able to reproduce here, but I wonder if this would help
(more or less a cut-and-paste from the hook-running code in
receive-pack):

diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index bb34757..c0a6a3b 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -843,7 +843,20 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix)
 			const char *argv_gc_auto[] = {
 				"gc", "--auto", "--quiet", NULL,
 			};
-			run_command_v_opt(argv_gc_auto, RUN_GIT_CMD);
+			struct child_process proc;
+
+			memset(&proc, 0, sizeof(proc));
+			proc.no_stdin = 1;
+			proc.stdout_to_stderr = 1;
+			proc.err = use_sideband ? -1 : 0;
+			proc.git_cmd = 1;
+			proc.argv = argv_gc_auto;
+
+			if (!start_command(&proc)) {
+				if (use_sideband)
+					copy_to_sideband(proc.err, -1, NULL);
+				finish_command(&proc);
+			}
 		}
 		if (auto_update_server_info)
 			update_server_info(0);

Unfortunately I can't actually test it. :)

-Peff

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: (Mosty harmless) protocol error when pushing
  2010-05-25  7:28 ` Jeff King
@ 2010-05-26  5:58   ` Björn Gustavsson
  2010-05-27 11:33     ` Ilari Liusvaara
  0 siblings, 1 reply; 5+ messages in thread
From: Björn Gustavsson @ 2010-05-26  5:58 UTC (permalink / raw)
  To: Jeff King; +Cc: git@vger.kernel.org

2010/5/25 Jeff King <peff@peff.net>:

> diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
> index bb34757..c0a6a3b 100644
> --- a/builtin/receive-pack.c
> +++ b/builtin/receive-pack.c
> @@ -843,7 +843,20 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix)
>                        const char *argv_gc_auto[] = {
>                                "gc", "--auto", "--quiet", NULL,
>                        };
> -                       run_command_v_opt(argv_gc_auto, RUN_GIT_CMD);
> +                       struct child_process proc;
> +
> +                       memset(&proc, 0, sizeof(proc));
> +                       proc.no_stdin = 1;
> +                       proc.stdout_to_stderr = 1;
> +                       proc.err = use_sideband ? -1 : 0;
> +                       proc.git_cmd = 1;
> +                       proc.argv = argv_gc_auto;
> +
> +                       if (!start_command(&proc)) {
> +                               if (use_sideband)
> +                                       copy_to_sideband(proc.err, -1, NULL);
> +                               finish_command(&proc);
> +                       }
>                }
>                if (auto_update_server_info)
>                        update_server_info(0);
>
> Unfortunately I can't actually test it. :)

Thanks!

Unfortunately, I was also unable to reproduce the problem,
so I can't test it either.

There is no easy way to force a GC on my repository at github,
so I tried to push to a local repository having too many loose
objects using the "file:" protocol but the problem did not occur
(i.e. the repository was auto packed but the protocol error did
not happen).

-- 
Björn Gustavsson, Erlang/OTP, Ericsson AB

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: (Mosty harmless) protocol error when pushing
  2010-05-26  5:58   ` Björn Gustavsson
@ 2010-05-27 11:33     ` Ilari Liusvaara
  2010-05-27 15:12       ` Jeff King
  0 siblings, 1 reply; 5+ messages in thread
From: Ilari Liusvaara @ 2010-05-27 11:33 UTC (permalink / raw)
  To: Björn Gustavsson; +Cc: Jeff King, git@vger.kernel.org

On Wed, May 26, 2010 at 07:58:29AM +0200, Björn Gustavsson wrote:
> 2010/5/25 Jeff King <peff@peff.net>:
> 
> Unfortunately, I was also unable to reproduce the problem,
> so I can't test it either.
> 
> There is no easy way to force a GC on my repository at github,
> so I tried to push to a local repository having too many loose
> objects using the "file:" protocol but the problem did not occur
> (i.e. the repository was auto packed but the protocol error did
> not happen).

I can't reproduce it either.

I tried testing using git:// over TLS. I could trigger the auto-gc,
but got no messages about it (hmm... other sideband messages do
work...) and no protocol error.

Git 1.7.1 on both sides.

-Ilari

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: (Mosty harmless) protocol error when pushing
  2010-05-27 11:33     ` Ilari Liusvaara
@ 2010-05-27 15:12       ` Jeff King
  0 siblings, 0 replies; 5+ messages in thread
From: Jeff King @ 2010-05-27 15:12 UTC (permalink / raw)
  To: Ilari Liusvaara; +Cc: Björn Gustavsson, git@vger.kernel.org

On Thu, May 27, 2010 at 02:33:05PM +0300, Ilari Liusvaara wrote:

> I can't reproduce it either.
> 
> I tried testing using git:// over TLS. I could trigger the auto-gc,
> but got no messages about it (hmm... other sideband messages do
> work...) and no protocol error.

Same here. But look at Björn's original error, which contained:

  fatal: protocol error: bad line length character: Remo

So I think it may not just be an auto-gc, but an auto-gc which provokes
prune-packed to say:

  Removing duplicate objects: 100% (256/256), done.

which happens only when it takes more than 2 seconds to remove all of
the objects. But I was still not able to reproduce it, even after
removing the delay:

diff --git a/builtin/prune-packed.c b/builtin/prune-packed.c
index f9463de..da1ab20 100644
--- a/builtin/prune-packed.c
+++ b/builtin/prune-packed.c
@@ -48,7 +48,7 @@ void prune_packed_objects(int opts)
 
 	if (opts == VERBOSE)
 		progress = start_progress_delay("Removing duplicate objects",
-			256, 95, 2);
+			256, 95, 0);
 
 	if (len > PATH_MAX - 42)
 		die("impossible object directory");

I notice that the original problem was seen when pushing to github. I
wonder if they are running an older version, or even a custom version
that behaves differently (perhaps with stdout and stderr file
descriptors set up differently for the gc or something like that).

-Peff

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-05-27 15:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-25  6:51 (Mosty harmless) protocol error when pushing Björn Gustavsson
2010-05-25  7:28 ` Jeff King
2010-05-26  5:58   ` Björn Gustavsson
2010-05-27 11:33     ` Ilari Liusvaara
2010-05-27 15:12       ` Jeff King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).