Hold the stream task's reports until the engine has announced the connection
The first smoke run of the adapter failed its stream directory scenario (the late viewer's WatchStream was refused with "not connected with voice"), and an alternating probe of that scenario with the baseline binary and this one on the TeamSpeak 6 dev server failed 3 of 6 for this branch and none of the baseline's four runs the server's clone limit left alone. The cause is an ordering the adapter lost. The TeamSpeak 6 stream task puts Event::StreamsChanged on the engine's bus itself; behind a session the engine hears of the connection only after the connect sequence (several requests through the driver), while the stream task lists the server's streams as soon as the server tells it, so a client that acts on the first list asked for a watch before the engine knew it had voice. The ts_session driver now holds the bus events of a link with streams that are no answer to a request until the engine's first stream command (session.rs sends one in its handling of Connected right after emitting the state), or for three seconds. Three unit tests pin the hold, its end, and that a link without streams is not held. The same probe passes 8 of 8; docs/session-seam.md section 13 records it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
bc9ccbc85e
commit
8c62030e5b
3 files changed
+138
-4
No files matched your search
@@ -883,6 +883,25 @@ public item was removed. Where the code differs from the text above:
|
||||
order. A packet from a slot the replica does not know yet fetches the
|
||||
queued pushes first and tries again, so a talker's first packet is not
|
||||
lost either way.
|
||||
- **The stream task's reports wait for the engine's announcement.** The
|
||||
TeamSpeak 6 stream task puts `Event::StreamsChanged` and the like on the
|
||||
engine's bus itself. Behind a session the engine learns of the connection
|
||||
only after the connect sequence (a few requests through the driver), while
|
||||
the stream task lists the server's streams as soon as the server tells it;
|
||||
a client that acts on the first list (`voelinctl gateway --engine
|
||||
--watch-streamer`, the `directory_check` of `scripts/it-smoke.sh`) sent
|
||||
`WatchStream` before the engine knew it had voice, and failed with `not
|
||||
connected with voice` in half of the runs (3 of 6; the baseline binary
|
||||
passed all 4 runs the server's clone limit did not end first, the two
|
||||
alternating on one TeamSpeak 6 server). The
|
||||
driver of `ts_session` therefore holds the stream task's bus events back
|
||||
(`Held` in `ts_session/driver.rs`; only for a link with streams, and only
|
||||
the events that are no answer to a request) until the engine's first
|
||||
stream command, which `session.rs` sends in its handling of `Connected`
|
||||
right after it has emitted the state, or for 3 seconds. Three unit tests
|
||||
pin it (`link/tests.rs`: held until the first stream command, not held for
|
||||
ever, not held for a link without streams); the same probe passes 8 of 8
|
||||
with it.
|
||||
- **CHAT scopes are re-subscribed in full.** The replica drops a scope's
|
||||
cursor and entities when it is unsubscribed and refuses a delta sync
|
||||
without a baseline, so SessionLink does not keep cursors for a delta
|
||||
|
||||
Reference in new issue
Block a user