Clarify lifetime of MongoExtensionHostPortal

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Query Integration
    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      We offer the HostPortal with the registerStageDescriptor() parameter when calling the extension initialization function. An extension developer could save a pointer to the HostPortal and attempt to call registerStageDescriptor() whenever it wants, even if it's far after extension initialization. I believe this would result in a segfault right now (since the host portal will have gone out of scope).

      We should be more clear that the lifetime of the HostPortal is confined to initialization time, and add a test for a malformed extension that attempts to save a pointer to use later.

      In SPM-4325 we're also adding a MongoExtensionHostServices struct. Maybe we should consider renaming this one to MongoExtensionInitializationHostPortal to make it extra clear that the lifetime is confined to initialization?

            Assignee:
            Will Buerger
            Reporter:
            Will Buerger
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: