lib/mongo/retryable.rb
def nro_write_with_retry(session, write_concern, &block)
      if session && session.client.options[:retry_writes]
        server = select_server(cluster, ServerSelector.primary, session)
        begin
          yield server
        rescue Error::SocketError, Error::SocketTimeoutError, Error::OperationFailure => e
          e.add_note('retries disabled')
          raise e
        end
      else
        legacy_write_with_retry(nil, session, &block)
      end
    end
# Retryable writes wrapper for operations not supporting modern retryable
# writes.
#
# If the driver is configured to use modern retryable writes, this method
# yields to the passed block exactly once, thus not retrying any writes.
#
# If the driver is configured to use legacy retryable writes, this method
# delegates to legacy_write_with_retry which performs write retries using
# legacy logic.
#
# @param [ nil | Session ] session Optional session to use with the operation.
# @param [ nil | Hash | WriteConcern::Base ] write_concern The write concern.
#
# @yieldparam [ Server ] server The server to which the write should be sent.
#
# @api private
Retryable writes wrapper for operations not supporting modern retryable
writes.

If the driver is configured to use modern retryable writes, this method
yields to the passed block exactly once, thus not retrying any writes.

If the driver is configured to use legacy retryable writes, this method
delegates to legacy_write_with_retry which performs write retries using
legacy logic.
Retryable writes wrapper for operations not supporting modern retryable writes . If the driver is configured to use modern retryable writes this method yields to the passed block exactly once thus not retrying any writes . If the driver is configured to use legacy retryable writes this method delegates to legacy_write_with_retry which performs write retries using legacy logic .
def nro_write_with_retry(session, write_concern, &block)
      if session && session.client.options[:retry_writes]
        server = select_server(cluster, ServerSelector.primary, session)
        begin
          yield server
        rescue Error::SocketError, Error::SocketTimeoutError, Error::OperationFailure => e
          e.add_note('retries disabled')
          raise e
        end
      else
        legacy_write_with_retry(nil, session, &block)
      end
    end
def nro_write_with_retry ( session , write_concern , & block ) if session && session . client . options [ :retry_writes ] server = select_server ( cluster , ServerSelector . primary , session ) begin yield server rescue Error :: SocketError , Error :: SocketTimeoutError , Error :: OperationFailure => e e . add_note ( 'retries disabled' ) raise e end else legacy_write_with_retry ( nil , session , & block ) end end
Retryable writes wrapper for operations not supporting modern retryable
writes.
Retryable writes wrapper for operations not supporting modern retryable writes .
session
write_concern
block
server The server to which the write should be sent.
server The server to which the write should be sent .
api
None