The blocking risk of Priority header when used a signal to the local stack

Lucas Pardue <lucaspardue.24.7@gmail.com> Mon, 18 November 2019 18:58 UTC

Return-Path: <ietf-http-wg-request+bounce-httpbisa-archive-bis2juki=lists.ie@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 0AB94120AD9 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Mon, 18 Nov 2019 10:58:56 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.751
X-Spam-Level:
X-Spam-Status: No, score=-2.751 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, HTML_MESSAGE=0.001, MAILING_LIST_MULTI=-1, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zZ3dED9E-nNI for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Mon, 18 Nov 2019 10:58:54 -0800 (PST)
Received: from frink.w3.org (frink.w3.org [IPv6:2603:400a:ffff:804:801e:34:0:38]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id DA728120AD5 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Mon, 18 Nov 2019 10:58:53 -0800 (PST)
Received: from lists by frink.w3.org with local (Exim 4.89) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1iWmC9-0003CI-6e for ietf-http-wg-dist@listhub.w3.org; Mon, 18 Nov 2019 18:56:17 +0000
Resent-Date: Mon, 18 Nov 2019 18:56:17 +0000
Resent-Message-Id: <E1iWmC9-0003CI-6e@frink.w3.org>
Received: from mimas.w3.org ([2603:400a:ffff:804:801e:34:0:4f]) by frink.w3.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from <lucaspardue.24.7@gmail.com>) id 1iWmC7-0003BS-1d for ietf-http-wg@listhub.w3.org; Mon, 18 Nov 2019 18:56:15 +0000
Received: from mail-vk1-xa2d.google.com ([2607:f8b0:4864:20::a2d]) by mimas.w3.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from <lucaspardue.24.7@gmail.com>) id 1iWmC5-0003WA-L3 for ietf-http-wg@w3.org; Mon, 18 Nov 2019 18:56:14 +0000
Received: by mail-vk1-xa2d.google.com with SMTP id l5so4370681vkb.4 for <ietf-http-wg@w3.org>; Mon, 18 Nov 2019 10:56:13 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=o/CRyCNtKYYgdESZLdBdi5rIF/wpdjLR2vLoUC/pR2o=; b=YhgLO868TwdzpMACSl+S563YOEH0y2x9t9JifbStp6W6/X0A2ctGWnN1kieK7dSI1V Ba43qly2++MmGBkWlAUsuUm41Vzu09TFkgMgXhf/ylZI8rbbwtJgYvD5WNIQ227UpByr b43PXOrMwKtAmOuoLHoPxGJsgJd5MkVQVA+mJ7oyDIJznkOq+bAnK23uJ7hxKdBEmO8f nmtCXIcPvWYDRCCGkf8mFkyJbFJaDAB7pgaGGmtqi9kYWcvasA0lkGoYyqyxszoq57Zy qWLCOizg/liM7/jOms+PFQgBznT0gyE6tP9YG64FPWN5qRhz2Bs+cfYBvBIPH7+PlrFk oLjQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=o/CRyCNtKYYgdESZLdBdi5rIF/wpdjLR2vLoUC/pR2o=; b=c87zxQ4z6zpRQSyhEp6L4LuLW03rjWGYNKlGOeETtN4QaG9grTxHgats3y7NzOPgxh obWEZtUoi5/QlVPUtnW+v+6S6XOqGF3KfweKRtZRynRFKfB0lVK0Lk0sulyFbq76Iqi4 IusNRHIkGji9C4uzYgwIRhudsgXIQSbxbcm8Vl4p4ReHan4q8mtUfndgb3/ZgtojuonO b2jW5po/6x2312H8wTt3Xa/Qg+7T+gTmZDpGkzawG/H6XAL2c2Q3WnQCqtU7kFPOfjev lAOyrpgxu3UTnCasMBS/rVo666cWFNoLfiit53l0zpu6RJeu6P01NbkoxJEShLAeepvA gmWA==
X-Gm-Message-State: APjAAAX86vzcxdfqZ+WgbRZoQlq0xfb3aMJku8mCEFNaZQOdqn7b30y6 /TJ0JKn0Xeu94BhWWIbCC6p3mTgcXlJowDysUabsZDaz
X-Google-Smtp-Source: APXvYqwsFzOLdwN4PE2f/2vDHJkLVBSu2QOt1rBFaqDjO7thR8g20vIKRuUg2+ktvRHA/kAKGwU6ki1ump2yjJ/J7VQ=
X-Received: by 2002:a1f:a752:: with SMTP id q79mr17649086vke.67.1574103372384; Mon, 18 Nov 2019 10:56:12 -0800 (PST)
MIME-Version: 1.0
From: Lucas Pardue <lucaspardue.24.7@gmail.com>
Date: Tue, 19 Nov 2019 02:55:17 +0800
Message-ID: <CALGR9obJLrTufZe+UGtzNmucyZa4oQCcOeuY+Aq9SwM4w0kaJg@mail.gmail.com>
To: HTTP Working Group <ietf-http-wg@w3.org>
Content-Type: multipart/alternative; boundary="0000000000005a05210597a38023"
Received-SPF: pass client-ip=2607:f8b0:4864:20::a2d; envelope-from=lucaspardue.24.7@gmail.com; helo=mail-vk1-xa2d.google.com
X-W3C-Hub-Spam-Status: No, score=-3.8
X-W3C-Hub-Spam-Report: BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, W3C_AA=-1, W3C_WL=-1
X-W3C-Scan-Sig: mimas.w3.org 1iWmC5-0003WA-L3 f56537c83841222a6b54ea7a0f3ea7d9
X-Original-To: ietf-http-wg@w3.org
Subject: The blocking risk of Priority header when used a signal to the local stack
Archived-At: <https://www.w3.org/mid/CALGR9obJLrTufZe+UGtzNmucyZa4oQCcOeuY+Aq9SwM4w0kaJg@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/37144
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <https://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

Hello all,

Following the WG session during IETF106 I wanted to pick up on a strand of
thought that I think Martin Thomson made at the microphone. I'm happy to
have a wrong interpretation, hence replaying it to the list for correction
or affirmation.

One of the ideas presented by the design team is that the Priority header
can be a stack-local control message that could cause the generation of a
version specific frame. This frame has certain requirements on ordering, it
must be issued before the request e.g. PRIORITY before HEADERS.

IIUC Martin identified a risk that delays in the stack-local signal could
cause delays in issuing the request e.g. HEADERS transmission is blocked
until the local stack can determine how to populate PRIORITY.

For many cases I'm sure this risk is low due to information locality and
APIs that use complete Request structures. However, a header streaming
example was mentioned and I wonder if this is a hypothetical case, or
something that can happen today.

One possible way this risk manifests could affect the ordering of request
transmission; high priority requests that somehow have their stack-local
signal delayed could get issued later than lower priority requests.  And it
is easy to imagine this being quite an opaque problem for developers to
debug.

There is also an anti-pattern mitigation to such a blocking problem.
Satisfy the requirement to always send PRIORITY first by applying a default
of either: the implementation's choice, or the default urgency/progressive
values by simply sending an empty PRIORITY. Then, reprioiritize the request
later based on more information. This is bad on many levels.

In contrast, expressing the initial priority as a header keeps it inline
with the request object for which it is signaling intent. This has some
advantages. But apply the above ordering problem in reverse, a server
processing requests only gains understanding of their priority when it
consumes the header. Should it block until that becomes available (or could
it even assume a default?). A partial design mitigation to this would be to
define priority as a pseudo-header, which forces the early emission and
processing of such information, and rules out trailers completely.

In summary, is blocking such as this a problem and should a solution try to
design around it?

Lucas