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

Allow child processes to destroy parent clients after resetting

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 1.7.0
    • Component/s: None
    • None

      Since PHPC-912, php_phongo_pclient_destroy (called during MSHUTDOWN) allows libmongoc clients created by parent processes to leak rather than call mongoc_client_destroy on them. That issue was released in 1.2.6 and was a necessary work-around to ensure that destroying a libmongoc client within a child process did not affect sockets created by parent processes; however, that CDRIVER-2049 (released in libmongoc 1.7.0) formally addressed that by adding pid-tracking to libmongoc's socket structs. Since then, socket fds are merely closed rather than shutdown.

      PHPC-1274 adds additional logic to reset libmongoc clients (CDRIVER-2857) created by parent processes, which will avoid a child killing sessions and cursors. This reset behavior has no effect on sockets (per CDRIVER-3116).

      We should investigate whether it's possible to remove the behavior in PHPC-912 and always destroy clients during MSHUTDOWN, after conditionally freeing the client if it was created by a parent process.

      One outstanding question is whether there might still be adverse effects for SSL connections as described in CDRIVER-3116, despite the socket pid-tracking from CDRIVER-2049. If there is any chance that the child process could disturb a parent's SSL connections, we should leave the current behavior as-is.

            Assignee:
            Unassigned Unassigned
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: