Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-836

Only log on server availability state changes

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.11.3, 3.0.0
    • Affects Version/s: None
    • Component/s: Monitoring
    • None
    • Minor Change

      Currently the driver logs exceptions while trying to connect (in the background monitor thread) to a replica set member/mongos in two circumstances:

      1. when state goes from ok to !ok
      2. otherwise, approximately 10% of the time when state is !ok

      The 10% rule is intended to reduce log flooding, but in a comment to this pull request, a commenter proposes a better idea: to log only the state changes, i.e.

      1. when state goes from ok to !ok
      2. when state goes from !ok to back to ok
      3. when the server state changes (like from primary to secondary, or has different tags.

            Assignee:
            Unassigned Unassigned
            Reporter:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: