Ensure retries do not use duplicate command payloads

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Monitoring
    • None
    • 🔵 Done
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      Some retryable reads/writes CommandStartedEvents publish duplicate command payloads. For example, the Collection.estimated_document_count code path constructs a command document, cmd = SON([('count', self.__name)]), and the initial attempt mutates this SON object and publishes it in a CommandStartedEvent. When the initial attempt fails and a retry is performed, it will mutate and publish the same SON object in the next CommandStartedEvent.

      This bug has minimal impact on end users since the two command attempts should be identical. However, this behavior undermines some assertions we make in our test suite and masks bugs like PYTHON-2390.

      To fix this bug we must ensure that the retry attempt uses a copy of the original command document.

            Assignee:
            Noah Stapp
            Reporter:
            Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: