Skip to content

Drop time sync bursts with a timed-out reply - #376

Open
maximmaxim345 wants to merge 2 commits into
mainfrom
docs/drop-timed-out-bursts
Open

maximmaxim345 wants to merge 2 commits into
mainfrom
docs/drop-timed-out-bursts

Conversation

@maximmaxim345

Copy link
Copy Markdown
Member

A server/time reply can get lost, for example when a server discards requests during a re-handshake. The client could then send the next message without the reply, and the burst still fed the filter. A burst with a timed-out reply now ends there and feeds the filter nothing.

Bursts still start no more than 10 seconds apart, so the reply timeout is the client's choice as long as the next burst starts on time.

Closes #356

Breaking changes

Clients that keep sending a burst after a timed-out reply, or feed the filter from such a burst, need an update, sendspin-cpp among them. Servers need no change.

Comment thread messaging.md Outdated
## Clock Synchronization

Clients send `client/time` messages to maintain an accurate mapping between their clock and the server's clock. Clients MUST send them in bursts, sending each message after the reply to the previous one arrives, and MUST feed the filter only the burst's measurement with the lowest [`max_error`](#time-filter) above 0. When a reply does not arrive within a timeout the client chooses, the client MAY send the next message without it. Each burst MUST contain at least 8 messages, and consecutive bursts MUST start no more than 10 seconds apart. Servers MUST NOT close the connection solely because a client's bursts break these rules. A server MAY drop a `client/time` request while its reply to an earlier `client/time` is still waiting to be sent.
Clients send `client/time` messages to maintain an accurate mapping between their clock and the server's clock. Clients MUST send them in bursts, sending each message after the reply to the previous one arrives, and MUST feed the filter only the burst's measurement with the lowest [`max_error`](#time-filter) above 0. When a reply does not arrive within a timeout the client chooses, the burst ends there and the client MUST NOT feed the filter from that burst. Each burst MUST contain at least 8 messages unless one of its replies times out, and consecutive bursts MUST start no more than 10 seconds apart. Servers MUST NOT close the connection solely because a client's bursts break these rules. A server MAY drop a `client/time` request while its reply to an earlier `client/time` is still waiting to be sent.

@kahrendt kahrendt Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a bit confusing to me: "unless one of its replies times out"

Your first change in the text is basically saying the burst is invalid and results shouldn't be used, so I don't think the quoted text is necessary.

Perhaps you can clarify the whole thing with describing a burst as valid (which has a minimum of 8 messages) or invalid, and only valid bursts feed the filter.

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.

Good point, I reworded it: a burst is valid when it has at least 8 messages and none of its replies timed out, and only valid bursts feed the filter.

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.

How should a client pick its server/time reply timeout?

2 participants