Subject: [pcp] about errors

From: Francis Dupont <[email-masked]>
Date: Thu, 10 Feb 2011 14:24:17 +0100

Currently errors are:
 - UNSUPP_{VERSION,OPCODE,OPTION,PROTOCOL}
 - MALFORMED_{OPTION,REQUEST}
 - UNSPECIFIED_ERROR
 - SERVER_OVERLOADED
 - NETWORK_FAILURE
 - NO_RESOURCES
 - NOT_AUTHORIZED
 - USER_EX_QUOTA
 - CANNOT_PROVIDE_EXTERNAL_PORT (ex CANNOT_HONOR_EXTERNAL_PORT
  BTW 8.5.3 still uses the old name in 04)
 - UNABLE_TO_DELETE_ALL
 - NONEXIST_PEER
 - IMPLICIT_MAPPING_EXISTS

The UNSUPP_VERSION is special as only the first word
of the message makes sense.

UNSUPP_*, MALFORMED_* and some cases of NOT_AUTHORIZED
are permanent: if the request is resent the same failure
response will be returned.

Some are clearly transient, i.e., they are bound to a
condition which can be cleared:
 - some cases of NOT_AUTHORIZED
 - SERVER_OVERLOADED, NETWORK_FAILURE, NO_RESOURCES,
  USER_EX_QUOTA, CANNOT_PROVIDE_EXTERNAL_PORT,
  NONEXIST_PEER, IMPLICIT_MAPPING_EXISTS and
  IMHO most cases of UNABLE_TO_DELETE_ALL.
I have nothing against the "please retry after this delay"
idea but in most cases the PCP server has no idea of
when the condition will be cleared, so I am afraid it can't
give a really useful indication to the PCP client other
than it is a transient error so you can retry later.
But this information is bound to the result code, so
I think it is better to add a comment in the spec with
a suggested delay, and to split ambiguous result code,
beginning by NOT_AUTHORIZED which is already too
overloaded. UNABLE_TO_DELETE_ALL is a good candidate too.

About the SERVER_OVERLOADED, I asked again the specified
behavior to be simply to drop messages which can't be
processed.

Regards

[email-masked]