Skip to content

Gate the sharded test on the server feature, and stop reusing connection ids - #59

Merged
pathscale merged 1 commit into
masterfrom
fix/sharded-test-features
Sep 23, 2026
Merged

pathscale merged 1 commit into
masterfrom
fix/sharded-test-features

Conversation

@pathscale

Copy link
Copy Markdown
Owner

Fixes master CI after #58. The ws-client-only row of Test supported feature boundaries failed.

  • Cause: tests/sharded_listen.rs was gated on ws-client alone, but it also starts a server. Without ws the server has no upgrader (default_upgrader() returns None) and resets every connection (errno 104 on Linux, 54 on macOS). The sharding code wasn't at fault. Now gated on all(ws, ws-client).
  • Found along the way: 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 shared WebsocketStates replaced the first. It's now an atomic counter seeded from the clock. New test ids_from_many_threads_never_repeat: 8 threads × 10k ids, all unique.
  • 3.3.1 → 3.3.2.

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). The ws-client row fails on current master (exit 101), reproducing CI. fmt, clippy --all-features -D warnings, and cargo check --no-default-features are clean.

…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.
@pathscale
pathscale merged commit f5f0538 into master Sep 23, 2026
@pathscale
pathscale deleted the fix/sharded-test-features branch September 23, 2026 23:23
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.

1 participant