Skip to content

Commit

Permalink
2516
Browse files Browse the repository at this point in the history
  • Loading branch information
p committed Apr 22, 2021
1 parent cbfd6c2 commit 6a53516
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/mongo/error/sdam_error_detection.rb
Expand Up @@ -28,6 +28,10 @@ module SdamErrorDetection
#
# @since 2.8.0
def not_master?
# Require the error to be communicated at the top level of the response
# for it to influence SDAM state. See DRIVERS-1376 / RUBY-2516.
return false if document['ok'] == 1

if node_recovering?
false
elsif code
Expand All @@ -47,6 +51,10 @@ def not_master?
#
# @since 2.8.0
def node_recovering?
# Require the error to be communicated at the top level of the response
# for it to influence SDAM state. See DRIVERS-1376 / RUBY-2516.
return false if document['ok'] == 1

if code
NODE_RECOVERING_CODES.include?(code)
elsif message
Expand Down

0 comments on commit 6a53516

Please sign in to comment.