Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-3184

Need to specify timeout for replica set

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Internal Client
    • Labels:
      None
    • Major Change

      We have run in-to following issue in our software:
      We have 3 servers running mongodb in replicaset configuration. One servers runs our application and is loaded by testing software at rate of 50 requests pes second. Then we configure iptables on server running primary monga node to drop all packets from and to other servers. By this we emulate network probems which may occur.
      In some small period of time (I think 20 seconds) secondary nodes understand, that link is broken and elect new primary. Server works fine. But not our application. C++ driver uses default network timeout for connection which on our system is 15 minutes. When netwok fails our application still tries to make queries and all available threas hang inside C++ driver waiting for network response. For next 15 minutes our service does not respond because all threads in thread pool are used out.
      What we need is to set timeout for about 15 seconds instead of 15 minutes.

      Attached patch adds ability to specify timeout to replica set. This patch breaks ABI, but API is backward compatible.

        1. diff
          65 kB
          Alexey Guseynov

            Assignee:
            Unassigned Unassigned
            Reporter:
            kibergus Alexey Guseynov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: