Re: Gen-ART and OPS-Dir review of draft-ietf-json-text-sequence-09

Nico Williams <nico@cryptonector.com> Tue, 09 December 2014 17:18 UTC

Return-Path: <nico@cryptonector.com>
X-Original-To: ietf@ietfa.amsl.com
Delivered-To: ietf@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B1AB41A89A4; Tue, 9 Dec 2014 09:18:43 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.666
X-Spam-Level:
X-Spam-Status: No, score=-1.666 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, IP_NOT_FRIENDLY=0.334, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=no
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 pNmQZOawagkm; Tue, 9 Dec 2014 09:18:42 -0800 (PST)
Received: from homiemail-a105.g.dreamhost.com (sub4.mail.dreamhost.com [69.163.253.135]) by ietfa.amsl.com (Postfix) with ESMTP id 5CB381A8984; Tue, 9 Dec 2014 09:17:30 -0800 (PST)
Received: from homiemail-a105.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a105.g.dreamhost.com (Postfix) with ESMTP id 3927F20046B15; Tue, 9 Dec 2014 09:17:30 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cryptonector.com; h=date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=cryptonector.com; bh=4pfVbFRe6rXtQ1 hTscWy8uJnYcY=; b=K1knMO/JW/yJEKIhl2Nlv9H+/uACtSw72vLz2yEDEdhUZn ohzTPdpIORzXoSy3uXcMpoKReoQ9vUajKfXeCk1AKVJUd6oGrANxe1DWH5hqYrxR O9IT4q8xEmlQwirMyIcv63p/wsipCCGODbJPDI9WXFa0Qi2zi3yM9Es4JRLV8=
Received: from localhost (108-207-244-174.lightspeed.austtx.sbcglobal.net [108.207.244.174]) (Authenticated sender: nico@cryptonector.com) by homiemail-a105.g.dreamhost.com (Postfix) with ESMTPA id B05792004692F; Tue, 9 Dec 2014 09:17:29 -0800 (PST)
Date: Tue, 9 Dec 2014 11:17:29 -0600
From: Nico Williams <nico@cryptonector.com>
To: "Black, David" <david.black@emc.com>
Subject: Re: Gen-ART and OPS-Dir review of draft-ietf-json-text-sequence-09
Message-ID: <20141209171724.GB12979@localhost>
References: <CE03DB3D7B45C245BCA0D24327794936289DC7@MX104CL02.corp.emc.com> <20141209041937.GD11221@localhost> <CE03DB3D7B45C245BCA0D243277949362AE54B@MX104CL02.corp.emc.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <CE03DB3D7B45C245BCA0D243277949362AE54B@MX104CL02.corp.emc.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Archived-At: http://mailarchive.ietf.org/arch/msg/ietf/Rwj_6b377r7JNiaig6LdcU5DcdU
Cc: "General Area Review Team \(gen-art@ietf.org\)" <gen-art@ietf.org>, "json@ietf.org" <json@ietf.org>, "ops-dir@ietf.org" <ops-dir@ietf.org>, "ietf@ietf.org" <ietf@ietf.org>
X-BeenThere: ietf@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: IETF-Discussion <ietf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ietf>, <mailto:ietf-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/ietf/>
List-Post: <mailto:ietf@ietf.org>
List-Help: <mailto:ietf-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ietf>, <mailto:ietf-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 09 Dec 2014 17:18:43 -0000

On Tue, Dec 09, 2014 at 04:41:12PM +0000, Black, David wrote:
> [A] JSON text parse failures
> > [...]
> 
> Your alternative wording "whenever the JSON text parse fails, ..." is fine.

OK.

> [D] Truncation
> 
> > A missing terminating LF is not a problem for strings, arrays, or
> > objects.  I seem to recall that we did discuss this.  We could require
> > that such texts fail to parse, but perhaps the more important thing is
> > to require common parser behavior as to such truncations.
> > 
> > You ABNF proposal is certainly more strict than the one in the I-D.  I'm
> > neutral as to whether this form or the one in the I-D (with the ws issue
> > fixed) is better.  The stricter form is clearly easier to talk about,
> > therefore preferable, but it will mean discarding texts where only that
> > terminating LF is truncated.
> 
> I concur with both of the above paragraphs - my preference is to detect
> incomplete JSON texts at the sequence level via the missing LF rather than
> special-casing numbers and relying on failed JSON parses for everything else.
> In general, earlier detection of errors increases the options for dealing
> with them.

And, of course, a streaming/incremental parsers might well output all
there is to output when only the last LF is missing but the top-level
value was properly delimited anyways.  So it's kinda difficult to get a
fool-proof requirement that the trailing LF must be present.

Your review comments included adding this note about incremental
parsing.  There's a conflict here between the two comments that had not
been apparent to me last night.  I now think that fixing the ws problem
is the best way forward.

> Once the incomplete text is detected, a JSON parse could be attempted,
> with the JSON parser knowing that the text is incomplete (e.g., text
> may fail to parse, a number at the end of the text must not be produced
> as an incremental parse result).

That's so for non-incremental parsers.  (Or when buffering the complete
text instead of handling incrementally, even though one has an
incremental parser.)

Consider one implementation I'm familiar with.  Its JSON text parser is
incremental (but not streaming), so it produces outputs with no need for
extra whitespace when the input text is a string, array, or object, but
for top-level numbers, booleans, and null, it needs to either read one
more byte or reach EOF before it will output them.

So I think we really do need to say something about top-level numbers
(and true, false, and null), namely: that they must be delimited by
whitespace, that '<RS>1234<RS>' is not a valid sequence element because
the number may have been truncated.  (Ditto '<RS>true<RS>', since the
intended text could have been 'trueish', which is invalid of course, but
still.)

> As for RFC 20 ...
> 
> > Is this resolved by now?  I can always reference only Unicode.
> 
> Keep the RFC 20 reference - I have no problem with it.  Moreover, as a
> result of all the hubbub around this nit, the IESG has issued a Last Call
> to reclassify RFC 20 as an Internet Standard ... so that this never
> arises again ...

Yes, I noticed.  I expect the IETF LC will pass for that.

Thanks,

Nico
--