Skip to content

Memoize replica set check; listener fixes and cleanup - #2

Merged
washu merged 12 commits into
mainfrom
fix/memoize-replica-set-listener-cleanups
Jun 1, 2026
Merged

Memoize replica set check; listener fixes and cleanup#2
washu merged 12 commits into
mainfrom
fix/memoize-replica-set-listener-cleanups

Conversation

@washu

@washu washu commented May 28, 2026

Copy link
Copy Markdown
Owner

This PR:

  • Memoizes replica_set_configured? so the MongoDB topology check runs only once per process (reduces round-trips).
  • Removes redundant logger / attr_reader :server overrides now provided by ActionCable::SubscriptionAdapter::Base.
  • Fixes listener backoff behavior: avoid sleeping on expected Change Stream timeouts and guard enum usage to prevent NoMethodError rescues.
  • Improves thread-safety by synchronizing access to @subscribers when building pipelines and handling documents.
  • Makes validate_replica_set! raise ReplicaSetRequiredError when configured to require a replica set.
  • Updates specs to reflect behavior and fixes a flaky change-stream test.
  • Updates .rubocop.yml TargetRubyVersion and README typo.
    All tests pass (48 examples, 0 failures) and I ran the benchmark locally with results in the PR comment.

@washu
washu merged commit ae3079b into main Jun 1, 2026
22 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