Re: MAX_CONCURRENT_STREAMS=0 and PUSH_PROMISE

Roberto Peon <grmocg@gmail.com> Tue, 23 July 2013 21:33 UTC

Return-Path: <ietf-http-wg-request@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 5607A11E830A for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 23 Jul 2013 14:33:32 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -10.448
X-Spam-Level:
X-Spam-Status: No, score=-10.448 tagged_above=-999 required=5 tests=[AWL=0.150, BAYES_00=-2.599, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-8]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fPplDFgUn7VA for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 23 Jul 2013 14:33:26 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) by ietfa.amsl.com (Postfix) with ESMTP id A40A111E8149 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Tue, 23 Jul 2013 14:33:25 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.72) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1V1kCh-0008Uc-KR for ietf-http-wg-dist@listhub.w3.org; Tue, 23 Jul 2013 21:33:07 +0000
Resent-Date: Tue, 23 Jul 2013 21:33:07 +0000
Resent-Message-Id: <E1V1kCh-0008Uc-KR@frink.w3.org>
Received: from lisa.w3.org ([128.30.52.41]) by frink.w3.org with esmtp (Exim 4.72) (envelope-from <grmocg@gmail.com>) id 1V1kCY-0008Ts-CQ for ietf-http-wg@listhub.w3.org; Tue, 23 Jul 2013 21:32:58 +0000
Received: from mail-ob0-f174.google.com ([209.85.214.174]) by lisa.w3.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.72) (envelope-from <grmocg@gmail.com>) id 1V1kCX-0000iu-HE for ietf-http-wg@w3.org; Tue, 23 Jul 2013 21:32:58 +0000
Received: by mail-ob0-f174.google.com with SMTP id wd20so11399876obb.33 for <ietf-http-wg@w3.org>; Tue, 23 Jul 2013 14:32:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=A5yFrwu36qQOu+u4hmD2Nwkv8mIsuv7PFp8AIhnLRVU=; b=gitZhGFQe0Gtk2faLNb46jpnwpb/YNb13hRz/2kkeOFnObJJiSGQeCjkAJYXVso4Gh gaSbS949+L/smmW2YkJir4GTqZ2vBALGQ0q6TUCXiaeymFy2rC9ja34fOg70vNSA3OHp Qrw3JBCHqjUj8XD5roKyquqA94qSyFGAVH7ySjBe2s7Y9b/KdyfqTNh2lfPi0Db65LAe xMEnOljSMOXu6ZqWEDnwp7QizuSBZpalsU3RSVN/ruvSMPstgTh7l6Sju0yAYwvHgMU0 +CVEA8lm0d9vKUuIsHU9Y43axyCiGLrYbbeJX1AQqHzNs4rjEBLU9mUG5mkXg/5Dyng4 VeMQ==
MIME-Version: 1.0
X-Received: by 10.182.71.38 with SMTP id r6mr26802640obu.64.1374615151502; Tue, 23 Jul 2013 14:32:31 -0700 (PDT)
Received: by 10.76.91.229 with HTTP; Tue, 23 Jul 2013 14:32:31 -0700 (PDT)
In-Reply-To: <20130723190419.GA25817@LK-Perkele-VII>
References: <CA+KJw_5PcUxBiUnQ00=G2C4Q6MnaB=hpNDk+9eTeZMs3Lz-CpA@mail.gmail.com> <CAP+FsNf7YBDfO_=fW7nPHXdUi0F+0+4S2AUm_T2gHtqYhER8MA@mail.gmail.com> <20130723190419.GA25817@LK-Perkele-VII>
Date: Tue, 23 Jul 2013 14:32:31 -0700
Message-ID: <CAP+FsNc5tef8WRCaH-_6z5se=vVPscSQ3+GfEF0T02q8oKq6WA@mail.gmail.com>
From: Roberto Peon <grmocg@gmail.com>
To: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Cc: Gábor Molnár <gabor.molnar@sch.bme.hu>, HTTP Working Group <ietf-http-wg@w3.org>
Content-Type: multipart/alternative; boundary="e89a8fb1f56cceed3104e2348791"
Received-SPF: pass client-ip=209.85.214.174; envelope-from=grmocg@gmail.com; helo=mail-ob0-f174.google.com
X-W3C-Hub-Spam-Status: No, score=-3.5
X-W3C-Hub-Spam-Report: AWL=-2.688, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001
X-W3C-Scan-Sig: lisa.w3.org 1V1kCX-0000iu-HE 5b3e993390dae88d5d98818efc01e48e
X-Original-To: ietf-http-wg@w3.org
Subject: Re: MAX_CONCURRENT_STREAMS=0 and PUSH_PROMISE
Archived-At: <http://www.w3.org/mid/CAP+FsNc5tef8WRCaH-_6z5se=vVPscSQ3+GfEF0T02q8oKq6WA@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/18890
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: <http://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

responses inline


On Tue, Jul 23, 2013 at 12:04 PM, Ilari Liusvaara <
ilari.liusvaara@elisanet.fi> wrote:

> On Tue, Jul 23, 2013 at 10:01:31AM -0700, Roberto Peon wrote:
> > The whole point of push-promise is to not count them, and so to avoid the
> > condition where the number of resources it wishes to push exceed the max
> > concurrent stream limit, causingna race.
>
> How it does cause a race? Stall the associated stream and open some
> promised
> streams if you have slots for it (if not, complete some old open pushed
> streams first). No races there.
>

The client, having no indication that a particular resource will be pushed,
will instead request the resource, and now the server may be pushing a
resource for which it is also responding to the client, solely because the
advertisement about what it was going to push was delayed.
In other words, that is a race if the server ever does intend to push the
resource.


>
> Or are you talking about client shrinking number of allowed promised frames
> mid-connection? Yeah, that sort of thing is fundamentally racy.
>

That would also be racy. Any limit would be racy.
The number of resources in a web page are not limited, thus the number of
signals that the resources will be pushed needs to be symmetrically
unlimited.


>
> > E.g. if max concurrent stream limit is 10, but I have 21 resources to
> push.
> > If push-promise counted, I'd be unable to advertise push promise for all
> of
> > these resources, potentially causing a race on the 11 resources the
> server
> > was not allowed to send luah-promise for. This would be true even if I
> was
> > sending the resources one at a time...
>
> Any sensible client (and especially proxy) is going to
> RST_STREAM(REFUSED_STREAM) any promised stream over some limit.
>
> Otherwise, have fun with 1,000,000,000 promised streams... And promised
> streams are not free for client/proxy.
>

True, you can get into abusive edge-cases where it is preferable to forget
about the push promise and allow the race.
In such cases, the client would RST the promised stream and request it.
This is a race with very different resultant semantics-- the server won't
be using up the available bandwidth twice at once. The client will know
exactly what it is doing.


>
> > You ask a separate question about whether or not push-promise can be sent
> > when max-concurrency is 0. Personally, I don't see any real harm in it.
> The
> > client can discard the data after putting them through the compressor.
> > Push-promise is only distinguishable from the headers  frame by the
> opcode,
> > so we should be talking about very minimal amounts of code.
>
> I regard that operation as just plain nonsense.
>

Then you're not thinking deeply enough yet :)
Even if push promises were limited by some configuration, changes to that
configuration can cause this condition to occur. Thus, clients must be able
to handle PUSH_PROMISE frames by at least discarding them.


>
> Want to test if client is going to send back RST_STREAM(REFUSED_STREAM) or
> GOAWAY(INTERNAL_ERROR)? :-)
>

This is something we have to test anyway? :)
-=R


>
> -Ilari
>