Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-278

GridFS issues wrong update with a _closed attribute

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.1
    • Affects Version/s: 2.0.1
    • Component/s: None
    • Labels:
      None

      When calling GridIn.close there's an interaction between self.closed = True and GridIn.setattr_. What this means is that right after closing GridIn there's an immediate and unnecessary update setting _closed field to true.

      If it is intended for user code to be able to set closed (and other underscore-starting fields) to arbitrary values, then GridIn.close should be changed to use object.setattr_(self, '_closed', True).

      If it was not intended then condition in _setattr_ should be changed to something like if self.closed and not name.startswith('')

      I'm not sure about priority, but I set it to Major because it greatly affects performance (the update is done using safe=True), floods oplog with these unnecessary updates and so is very annoying.

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            snaury Alexey Borzenkov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: