Repository navigation
Gate the sharded test on the server feature, and stop reusing connection ids - #59
Merged
Merged
Conversation
…ion ids tests/sharded_listen.rs asked only for ws-client, but it also runs a server, and without ws the server has no upgrader and resets every connection. CI's ws-client-only row failed on it after 3.3.1 merged. It now needs both. get_conn_id was the clock in microseconds cut to 32 bits, so two connections accepted in the same microsecond shared an id. With shards accepting in parallel that is two threads at once, and the second insert into the shared connection table replaced the first. It is a counter now, seeded from the clock. Release as 3.3.2.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes master CI after #58. The
ws-client-only row of Test supported feature boundaries failed.tests/sharded_listen.rswas gated onws-clientalone, but it also starts a server. Withoutwsthe server has no upgrader (default_upgrader()returnsNone) and resets every connection (errno 104 on Linux, 54 on macOS). The sharding code wasn't at fault. Now gated onall(ws, ws-client).get_conn_id()was the microsecond clock truncated to u32, so two connections accepted in the same microsecond got the same id. With shards accepting in parallel, the second insert into the sharedWebsocketStatesreplaced the first. It's now an atomic counter seeded from the clock. New testids_from_many_threads_never_repeat: 8 threads × 10k ids, all unique.Verified locally on macOS: every row of the CI matrix exits 0 (
--no-default-features, default,agent-control,ws-client,ws,full,--all-features: 0/58/14/113/124/134/152 passed). Thews-clientrow fails on current master (exit 101), reproducing CI. fmt, clippy--all-features -D warnings, andcargo check --no-default-featuresare clean.