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

Document that persistent sockets should not be re-used after forking

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.2.0
    • Affects Version/s: 1.1.4
    • Component/s: Docs
    • Labels:
      None

      Forked processes are prone to re-using a previous socket, which can lead to all sorts of IO errors (e.g. out-of-order replies on the wire protocol) between the parent and child processes.

      The legacy driver annotated persisted sockets with a PID so that they could be forgotten during selection if the PID did not still match.

      Per PHPC-433, we should include the process ID in the mongoc_client_t hash to ensure that persisted clients are not reused if a forked process constructs a new Manager. We should also document that Managers should not be created before forking and used in child processes.

            Assignee:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            ZorgUK Wayne Robinson [X]
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: