Appended client metadata may be inadvertently applied to all future clients

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Minor - P4
    • None
    • Affects Version/s: 1.8.0
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Per mongoc-handshake.h, mongoc_handshake_data_append can only be called once per process. After the first call, the global handshake data is frozen and subsequent calls to the function return false. PHPC does not check the return value.

      This means that the first "driver" option in a Manager's $driverOptions seen by PHPC will apply to all future libmongoc clients and their handshakes for the lifetime of that PHP worker.

      I think I originally called attention to this in PHPC-1494; however, it didn't come up in the code review (mongodb/mongo-php-driver#1114). This also isn't discussed in the PHP.net documentation for the driver option, although I think it'd be a challenge to do so clearly.

      I don't believe this can be addressed without changes to libmongoc that would allow each client to specify its own handshake data (beyond appname), but I wanted to open this ticket so we can at least track the issue.

            Assignee:
            Unassigned
            Reporter:
            Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: