File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,9 @@ class ConnectionBase < ConnectionCommon
8989 :mongos?
9090
9191 # @return [ nil | Object ] The service id, if any.
92- def_delegators :description , :service_id
92+ def service_id
93+ description &.service_id
94+ end
9395
9496 # Connection pool generation from which this connection was created.
9597 # May be nil.
Original file line number Diff line number Diff line change @@ -128,15 +128,17 @@ def add_server_diagnostics
128128 if respond_to? ( :id )
129129 note << ", connection #{ generation } :#{ id } "
130130 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 } "
133135 end
134136 e . add_note ( note )
135137 if respond_to? ( :generation )
136138 # Non-monitoring connections
137139 e . generation = generation
138140 if respond_to? ( :description )
139- e . service_id = description &. service_id
141+ e . service_id = service_id
140142 end
141143 end
142144 raise e
You can’t perform that action at this time.
0 commit comments