Subject: [xmpp] "in-order processing"

From: Peter Saint-Andre <[email-masked]>
Date: Thu, 30 Sep 2010 15:05:58 -0600

A discussion broke out yesterday on the [email-masked] list about
in-order processing of stanzas, starting here:

http://mail.jabber.org/pipermail/standards/2010-September/023866.html

Currently Section 10.1 of 3920bis-16 states:

   An XMPP server MUST ensure in-order processing of XML stanzas between
   any two entities.  This includes stanzas sent by a client to its
   server for direct processing by the server (e.g., in-order processing
   of a roster get and initial presence as described in [XMPP-IM]).

Two questions arose:

1. What exactly do we mean by "in-order processing"?

2. What exactly do we mean by "entities" here (bare JID, full JID,
partner to an XML stream)?

I'll let folks who posted in that discussion re-post here so that we can
figure this out...

Peter

-- 
Peter Saint-Andre
https://stpeter.im/

---

From: Justin Karneges <[email-masked]>
Date: Thu, 30 Sep 2010 23:42:18 -0700

> I'll let folks who posted in that discussion re-post here so that we can

Here's a summary of what has been discussed:

- There needs to be rules both for stanza delivery order as well as the order 
in which stanzas are acted upon by the destination entity.  It is not super 
clear from the current text that "in-order processing" would mean either of 
these things, though implementors have usually assumed it to be one or both, 
based on historical expectations of XMPP/Jabber.

- Implementations differ.  The XCP server ensures delivery order between pairs 
of bare JIDs.  The Tigase server ensures delivery order between pairs of full 
JIDs.

- Due to the differing interpretations of section 10.1, there is interest in 
the spec being clarified.

Dave Cridland suggested the following new text:

"Servers MUST ensure in-order processing of the stanzas received on a stream. 
Servers MUST resolve any ambiguity caused by processing requests (for example, 
those sent to the bare jid of a connected client); in the case where the 
result of a request could have an effect on subsequent stanzas, servers MUST 
suspend processing of stanzas until the request is completed. Servers MUST 
ensure that any stanzas forwarded from a stream to a particular remote domain 
are forwarded in order - in particular, this implies that for any given 
inbound stanza that is addressed to a remote domain, there SHOULD be at most 
one outbound stream, used consistently."

Instead of ordering by bare JID pairs or full JID pairs, the above text 
suggests ordering by streams at each hop.  For example, if stanzas directed to 
[email-masked] and [email-masked]/resource would both be sent to the same 
client stream, then these stanzas should be delivered in order to that stream.

The only critique of this approach has been that ordering by stream, instead 
of by bare JID, may end up producing unordered receipt if client connections 
disconnect and stanzas end up getting routed to alternate resources or offline 
storage.  Dave believes it is not practical to try solving this.

-Justin