Skip to content

docs: s2s reconnect advice - #20

Open
infiniteregrets wants to merge 2 commits into
mainfrom
m/s2s-reconnect-advice
Open

docs: s2s reconnect advice#20
infiniteregrets wants to merge 2 commits into
mainfrom
m/s2s-reconnect-advice

Conversation

@infiniteregrets

Copy link
Copy Markdown
Member

Document the reconnect-advised bit in the S2S flag byte and the graceful shutdown contract:

  • Flag byte bit 4 (A): server sets it on regular messages before terminating. Body is unchanged, so clients that ignore the bit keep working.
  • New Reconnect advice section: read sessions re-establish, append clients half-close and receive acknowledgements followed by a clean end, and append sessions still attached when the server drains are ended with terminal 503 code server_draining. Acknowledgements always precede the terminal message, so unresolved inputs can be safely resubmitted on a new session.

Matches the protocol additions released in s2-api 0.31.1 (s2-streamstore/s2#700).

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Comment thread s2/v1/s2s.md Outdated
A server that is about to terminate sets the reconnect-advised flag on regular messages. The message body is unchanged, so clients that ignore the flag keep working.

* **Read** sessions should be re-established with a fresh request.
* **Append** sessions should stop sending inputs and half-close the request stream. The server acknowledges all accepted inputs and then ends the session cleanly.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is missing the complete picture for clients, who also need to establish a new session to start using once all acks for in-flight appends have been received. Establishing the new session can happen concurrently.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ptal

Comment thread s2/v1/s2s.md Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants