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

mongoid.yml template socket timeout default is incorrect

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 7.4.1, 7.3.5
    • Affects Version/s: None
    • Component/s: None
    • Fully Compatible

      in lib/rails/generators/mongoid/config/templates/mongoid.yml

      1. The timeout to wait to execute operations on a socket before raising an error.
      2. (default: 5)
      3. socket_timeout: 5

       

      in docs/reference/configuration.txt

      1. The timeout to wait to execute operations on a socket before raising an error.
      2. (default: nil)
        socket_timeout: 5

       

      It appears the latter is correct–the default socket timeout is nil.


      As a real-world mongo user, I would suggest we set the default to 5 seconds in the next major release (Mongoid 8.0) Something conservative like 30 seconds would make sense to add as a default now.

      Given that large queries are done using GET_MORE cursors (which will not be subject to the timeout as long as each iteration is under X sec), there is really no practical case where you'd want to set it to something higher than 30 seconds; it typically means your queries are unindexed and you're going to kill your database.

      Don't ask me how I know

            Assignee:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Reporter:
            shields@tablecheck.com Johnny Shields
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: