-
Notifications
You must be signed in to change notification settings - Fork 237
Open
Labels
defectSuspected defect such as a bug or regressionSuspected defect such as a bug or regression
Description
Observed behavior
The client currently handles error code 10071 (JSStreamWrongLastSequenceErrF) and converts it to a KeyWrongLastSequenceError so that the client can retry the CAS collision. But the server also returns error code 10164 (JSStreamWrongLastSequenceConstantErr) which seems to represent the same condition, but the SDK doesn't handle it. That means the caller has to do something like this on every jetstream call:
except (KeyWrongLastSequenceError, BadRequestError) as e:
should_retry = isinstance(e, KeyWrongLastSequenceError) or (
isinstance(e, BadRequestError)
and getattr(e, "err_code", None) == 10164
)
if not should_retry:
# not a CAS 400 — raise it
raise
getattr is necessary because the exceptions don't always have the error code set.
This should be handled consistently in the SDK
Expected behavior
A jetstream call, e.g. update, raises a KeyWrongLastSequenceError in all cases where a CAS retry is appropriate
Server and client version
Client: 2.11.0
Server: 2.11.5
Host environment
No response
Steps to reproduce
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
defectSuspected defect such as a bug or regressionSuspected defect such as a bug or regression