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

Executing commands from within an APM callback may cause deep recursion and segfault

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      If an APM subscriber were to execute a database command from a listener method (e.g. commandStarted, it could result in a recursion chain and crash the PHP interpreter (see: http://phpsadness.com/sad/50).

      We should consider adding a guard around APM event dispatching to avoid this. Otherwise, we should at least document the risk of doing so and advise users not to execute commands from an APM listener without some filtering mechanism.

      A potential scenario where this could come up might be if an application fed its APM events to a logging service, and that logging service in turn was configured to store data in MongoDB.

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

              Created:
              Updated: