Skip to content

Fixes NoMethodError for empty routing tables#2

Open
L33tH4x0r wants to merge 2 commits into4.4.6from
VST-98338-Fix-Nil-On-Routing-Table
Open

Fixes NoMethodError for empty routing tables#2
L33tH4x0r wants to merge 2 commits into4.4.6from
VST-98338-Fix-Nil-On-Routing-Table

Conversation

@L33tH4x0r
Copy link

Addresses a NoMethodError that occurred when internal routing table collections were empty. The reduce(&:+) method previously returned nil for empty arrays, leading to errors when further operations were attempted on the result.

Initializes the reduce operation with Set.new to guarantee that a Set is always returned, even when the input collection is empty. This prevents the NoMethodError and correctly accumulates unique server addresses into a set.

  • Improves robustness of routing table server address collection.
  • Bumps driver version to 4.4.6.

Fixes VST-98338

Give reduce a default set to work with instead of returning nil in all_servers and
fresh_cluster_composition_fetched. reduce(&:+) returns nil on empty
sets, causing undefined method 'map' for nil when the routing table
registry has no handlers.

Made-with: Cursor
@L33tH4x0r L33tH4x0r added bug Something isn't working code review labels Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working code review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants