Subject: [core] Stateless proxy and 5.04 (Gateway Timeout)

From: Christer Holmberg <[email-masked]>
Date: Sun, 3 Nov 2019 08:32:55 +0000

Hi,

I have a couple of questions for clarification on Section 3.2. of  the stateless draft:

The text says:

   ”Such an intermediary might want to be "stateless" as well, i.e., be
   alleviated of storing the client's token and transport address for
   received requests.  This can be implemented by serializing this
   information along the request state into the token towards the origin
   server.  When the intermediary receives the response, it can recover
   the information from the token and use it to satisfy the client's
   request.”

Q1: If the intermediary does *not* receive a response to the request sent towards the origin server, how can it send the 5.04 (Gateway Timeout) response?

Q2: If the intermediary does not maintain request state, how can it even associate a request a timeout timer (that would trigger the 5.04 response) with the request sent towards the origin server?

Regards

Christer

---

From: Christian Amsüss <[email-masked]>
Date: Sun, 3 Nov 2019 15:46:53 +0100

Hello Christer,

On Sun, Nov 03, 2019 at 08:32:55AM +0000, Christer Holmberg wrote:
> Q1: If the intermediary does *not* receive a response to the request
> sent towards the origin server, how can it send the 5.04 (Gateway
> Timeout) response?
>
> Q2: If the intermediary does not maintain request state, how can it
> even associate a request a timeout timer (that would trigger the 5.04
> response) with the request sent towards the origin server?

I would not expect a stateless proxy to generate 5.04 errors after a
timeout after sending a request.

What the stateless proxy does need to do is to keep some state about the
server it is talking to (in order to satisfy flow control requirements).
If that state indicates unavailability of the server, it could return
some 5.xx error (possibly even 5.04, don't know their precise
definitions off my head) immediately to a new incoming request for that
server.

Best regards
Christian

-- 
This may seem a bit weird, but that's okay, because it is weird.
  -- perldata(1) about perl variables

---

From: Klaus Hartke <[email-masked]>
Date: Sun, 3 Nov 2019 15:53:08 +0100

> definitions off my head) immediately to a new incoming request for that

I think it would be good to capture these considerations in the draft.
I'll hold back -04 for now so we can make these additions.

Klaus

---

From: Klaus Hartke <[email-masked]>
Date: Wed, 20 Nov 2019 15:10:26 +0100

> timeout after sending a request.

RFC 7252 [1] is actually quite strict on that, though:

   If the request to the destination times out, then a 5.04 (Gateway
   Timeout) response MUST be returned.

It seems we need to override that MUST if we want to allow "stateless"
intermediaries...

Klaus

[1] https://tools.ietf.org/html/rfc7252#section-5.7.1

---

From: Klaus Hartke <[email-masked]>
Date: Wed, 20 Nov 2019 15:16:20 +0100

Christer Holmberg <[email-masked]> wrote:
> There are other features based on request state that may also need some clarification.
>
> For example, Section 3.5 of RFC 7641 says: [...]
>
> Related to that, Section 3.6 of RFC 7641 says: [...]

I don't think we can make RFC 7641 work across a stateless proxy. The
draft [1] already forbids it:

   ... an intermediary MUST NOT include an Observe Option in
   requests it sends without keeping request state.

Klaus

[1] https://tools.ietf.org/html/draft-ietf-core-stateless-03#section-3.2

---

From: Carsten Bormann <[email-masked]>
Date: Thu, 21 Nov 2019 19:17:56 +0800

>   Timeout) response MUST be returned.

How can the request time out if the proxy has forgotten all about it?

In this case, the timeout cannot be anything but infinite.

Grüße, Carsten

---

From: Christian Amsüss <[email-masked]>
Date: Fri, 22 Nov 2019 09:53:01 +0100

> In this case, the timeout cannot be anything but infinite.

A more precise definition of "times out" might have been "if the proxy
decides to discard any state it had to hold about the request". For a
stateless proxy, that won't happen.

(A stateless proxy might have an LRU cache of origin server for which it
keeps per-server state, but a server falling out of that should not
impede the forwardability of responses).

Best regards
Christian

-- 
I shouldn't have written all those tank programs.
  -- Kevin Flynn