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

GridFS issues wrong update with a _closed attribute

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 2.0.1
    • 2.1
    • None
    • None

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: