Skip to content

Make subscriber cleanup race-safe - #121

Merged
dallison merged 4 commits into
mainfrom
server_cleanup2
Aug 25, 2026
Merged

Make subscriber cleanup race-safe#121
dallison merged 4 commits into
mainfrom
server_cleanup2

Conversation

@dallison

@dallison dallison commented Aug 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • make subscriber disconnect cleanup authoritative by clearing unread delivery records, releasing every slot reference recorded in sub_owners, and retiring slots that become eligible after the subscriber count changes
  • make publication, subscriber registration, and subscriber removal race-safe by keeping slots publisher-owned until delivery records are complete, rechecking membership around bitset writes, and deferring current-generation queue entries until commit
  • align C++ and Rust shared-memory behavior with atomic subscriber counters, per-vchan cleanup generations, deduplicated retirement notifications, CCB v5, architecture documentation, and deterministic crash/race coverage

Test plan

  • bazelisk test //client:client_test //rust_client:client_test //common:common_test //server:server_test //shadow:shadow_test //c_client:client_test
  • bazelisk test //... --nocache_test_results
  • git diff --check

Remove server-side waiting by coordinating publication commits with subscriber teardown, preserving slot and split-buffer safety across crashes.
Wait for the complete replicated topology before restarting the server so recovery assertions cannot race pending shadow events.
Ensure publisher cleanup cannot erase delivery bits seeded by a subscriber ID that is concurrently reused.
@dallison
dallison merged commit 0e95138 into main Aug 25, 2026
46 checks passed
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