Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-1857

Driver invokes WC#unacknowledged? bypassing string/symbol conversions

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 2.10.0.rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      The WriteConcern module has a private method unacknowledged? that determines whether write concern options correspond to an acknowledged write concern. Despite being private to the WC module, this method is called from other places in the driver where it receives user input. In particular, the user input may have string keys rather than symbol keys, and calling unacknowledged? on string key write concern options silently produces wrong results.

      Furthermore, the method itself is not correctly implemented. Constructors of both acked and unacked write concern classes convert strings to symbols, but unacknowledged? method does not. Thus when given input of {{

      {w:0}

      }} the WC#get call will create an acknowledged write concern with w:0 which is wrong.

            Assignee:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: