Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-1734

retry_on_connection_failure - it's like DDOS attack

    • Type: Icon: Task Task
    • Resolution: Done
    • 2.4.5
    • Affects Version/s: None
    • Component/s: None
    • None

      Sleep half second is small. If mongoid not connect to replica set, it's like DDOS attack to mongo. Better solution is:

      <pre>
      def increase_retry_attempts(retries, ex)
      retries += 1
      raise ex if retries > Mongoid.max_retries_on_connection_failure
      Kernel.sleep(retries) // against 0.5s
      log_retry retries, ex
      retries
      end
      </pre>

      m.

            Assignee:
            Unassigned Unassigned
            Reporter:
            rubydev rubydev
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: