From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5400FC83000 for ; Tue, 28 Apr 2020 19:24:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 093B220730 for ; Tue, 28 Apr 2020 19:24:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=pobox.com header.i=@pobox.com header.b="gH3wWYcu" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728698AbgD1TYK (ORCPT ); Tue, 28 Apr 2020 15:24:10 -0400 Received: from pb-smtp1.pobox.com ([64.147.108.70]:58242 "EHLO pb-smtp1.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728515AbgD1TYK (ORCPT ); Tue, 28 Apr 2020 15:24:10 -0400 Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 2E1144C8F7; Tue, 28 Apr 2020 15:24:08 -0400 (EDT) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=R/YJwDty6JGe dYMCQxlchvlG1rI=; b=gH3wWYcuU/XRw6oa79J563X+eNI+IwgYZL7Zsk9hhlE7 W2kyMzLBKZbwi3/RTrQTUNVqZx6g4kgg7volC8/lMc2BPfx/ZGAwtUS8OfVMO/F+ VKQDrkYozG8I/rKXqt45K4FDBlgUReDttSwn3oVXsIqNhW0uvA3oOU7X9Dpj68o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=sasl; b=OIW0p3 R6Fc1yjGI2qofuEqLP+l4ArO4riltrcGEJqpsMceEm1Gfy5KAXAjBRGyuRDZW8+R lOKsjhui0f1zazlKjxqhE13lzRaevlSQ5UqpVr4xyn2Yt1G6qo5UziFr4T6BHOGh DNkRW7Ad97XVrBDkCeELFDPKNY7JEip/QR328= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 138554C8F6; Tue, 28 Apr 2020 15:24:08 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [34.74.119.39]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 6523E4C8F3; Tue, 28 Apr 2020 15:24:07 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: Christian Couder Cc: git@vger.kernel.org, Jeff King , Taylor Blau , SZEDER =?utf-8?Q?G=C3=A1bor?= , Derrick Stolee , Christian Couder Subject: Re: [PATCH v2] fetch-pack: try harder to read an ERR packet References: <20200428074442.29830-1-chriscool@tuxfamily.org> Date: Tue, 28 Apr 2020 12:24:06 -0700 In-Reply-To: <20200428074442.29830-1-chriscool@tuxfamily.org> (Christian Couder's message of "Tue, 28 Apr 2020 09:44:42 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Pobox-Relay-ID: D457E444-8985-11EA-8250-C28CBED8090B-77302942!pb-smtp1.pobox.com Content-Transfer-Encoding: quoted-printable Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Christian Couder writes: > From: SZEDER G=C3=A1bor > > When the server has hung up after sending an ERR packet to the > client, the client might still be writing, for example a "done" > line. Therefore the client might get a write error before reading > the ERR packet. > > When fetching, this could result in the client displaying a > "Broken pipe" error, instead of the more useful error sent by > the server in the ERR packet. Hmm, if the connection gets severed just before the ERR packet the other side has written, we will see "Broken pipe" if we write "done", and no amount of "try to read to collect as much what they said as possible" would help. If you are lucky and the connection is broken after the ERR reaches on this side, such an "extra effort" may help, but is it really worth the effort? It is not clear to me if the extra complexity, one more API function people need to learn, and the need to think which one to use every time they want to say write_in_full(), are justifiable. I dunno.