git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: git@vger.kernel.org
Subject: [PATCH 0/2] handling REF_STATUS_EXPECTING_REPORT over http
Date: Mon, 18 Oct 2021 15:34:59 -0400	[thread overview]
Message-ID: <YW3MY6lAI5l+BOnP@coredump.intra.peff.net> (raw)

I recently saw a case where GitHub's server implementation failed to
correctly report ref statuses. In this case it was because it hit an
internal timeout, but the root cause doesn't really matter; the server
is doing the wrong thing.

But what's interesting on the Git client side is that we produce quite a
confusing message for http. For ssh, we correctly say something like (in
this example, I'm pushing an absurd number of tags that causes the
timeout):

   To ssh://github.com/some/repo
    ! [remote failure]  tag-1 -> tag-1 (remote failed to report status)
   [...etc...]
    ! [remote failure]  tag-999 -> tag-999 (remote failed to report status)
   error: failed to push some refs to 'ssh://github.com/some/repo'

but for http, I get just:

  Everything up-to-date

Which is misleading to say the least. The issue is communication between
send-pack and remote-curl on the client side.

The first patch does the minimal fix. The second one has some cosmetic
improvements. They arguably could be squashed together, but I think
keeping them split shows exactly what the second patch is actually
accomplishing (especially with the minor change to the expected output
in the test).

This bug has been around since smart http was added in 2009. I just
prepared it on master, but I expect it could also go to maint.

  [1/2]: send-pack: complain about "expecting report" with --helper-status
  [2/2]: transport-helper: recognize "expecting report" error from send-pack

 builtin/send-pack.c            |  4 ++++
 t/lib-httpd.sh                 |  1 +
 t/lib-httpd/apache.conf        |  4 ++++
 t/lib-httpd/error-no-report.sh |  6 ++++++
 t/t5541-http-push-smart.sh     | 16 ++++++++++++++++
 transport-helper.c             |  4 ++++
 6 files changed, 35 insertions(+)
 create mode 100644 t/lib-httpd/error-no-report.sh

-Peff

             reply	other threads:[~2021-10-18 19:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-18 19:34 Jeff King [this message]
2021-10-18 19:43 ` [PATCH 1/2] send-pack: complain about "expecting report" with --helper-status Jeff King
2021-10-18 20:26   ` Junio C Hamano
2021-10-18 19:45 ` [PATCH 2/2] transport-helper: recognize "expecting report" error from send-pack Jeff King
2021-10-19 23:58 ` [PATCH 0/2] handling REF_STATUS_EXPECTING_REPORT over http brian m. carlson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YW3MY6lAI5l+BOnP@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).