Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-932

Remove reference to Manager on Cursor, Server, and WriteResult objects

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3.0-beta1, 1.3.0
    • Component/s: None
    • Labels:
      None

      Description

      Before mongoc_client_t persistence was implemented in PHPC-433, mongoc_client_t objects were destroyed when freeing a Manager object. This required adding a reference to Manager objects on Cursor, Server, and WriteResult objects in PHPC-671 to avoid potential use-after-free scenarios with mongoc_client_t if a Manager was freed before other objects depending on the same client.

      This is no longer necessary in 1.2.0 and actually impedes implementation of APM in PHPC-349, since clients may now shared by multiple Managers. Removing the reference to Manager objects from these other classes will allow APM to only deal with mongoc_client_t objects and still allow creation of Server objects without a Manager.

      By reverting PHPC-671, we can leave its regression tests in place to ensure that there is no longer a use-after-free concern.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jmikola Jeremy Mikola
              Reporter:
              jmikola Jeremy Mikola
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: