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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 1.1.4
    • Fix Version/s: 1.2.0
    • Labels:

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                2 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: