Don't allow 0 maxStaleness in ReadPreference API

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Done
    • Priority: Major - P3
    • 3.4.0-rc1, 3.4.0
    • Affects Version/s: None
    • Component/s: Query Operations
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The driver currently allows a value of 0 for maxStaleness, which it documents to mean "no maximum". This is unnecessarily confusing, as users might thing, despite the API docs, that maxStaleness of 0 means "totally fresh".

      Consider changing the ReadPreference API to not treat 0 specially, and require either:

      • use of overloaded factory methods that don't take a maxStaleness parameter to indicate that there is no maximum
      • use boxed Long so that null can be passed as a value, and don't treat 0 specially.

            Assignee:
            Jeffrey Yemin
            Reporter:
            Jeffrey Yemin
            None
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: