File tree 2 files changed +8
-4
lines changed
2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,9 @@ class ConnectionBase < ConnectionCommon
89
89
:mongos?
90
90
91
91
# @return [ nil | Object ] The service id, if any.
92
- def_delegators :description , :service_id
92
+ def service_id
93
+ description &.service_id
94
+ end
93
95
94
96
# Connection pool generation from which this connection was created.
95
97
# May be nil.
Original file line number Diff line number Diff line change @@ -128,15 +128,17 @@ def add_server_diagnostics
128
128
if respond_to? ( :id )
129
129
note << ", connection #{ generation } :#{ id } "
130
130
end
131
- if respond_to? ( :description ) && description &.service_id
132
- note << ", service id #{ description . service_id } "
131
+ # Non-monitoring connections have service id.
132
+ # Monitoring connections do not.
133
+ if respond_to? ( :service_id ) && service_id
134
+ note << ", service id #{ service_id } "
133
135
end
134
136
e . add_note ( note )
135
137
if respond_to? ( :generation )
136
138
# Non-monitoring connections
137
139
e . generation = generation
138
140
if respond_to? ( :description )
139
- e . service_id = description &. service_id
141
+ e . service_id = service_id
140
142
end
141
143
end
142
144
raise e
You can’t perform that action at this time.
0 commit comments