sdk::ExtensionStatusException does not correctly report error messages

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Integration
    • None
    • 3
    • TBD
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      When loading an extension into the host fails, we discovered that error messages from the extension are not correctly propagated to the host. 

      This can be reproduced by starting mongod and loading an erroneous extension:

      bazel-bin/install/bin/mongod --setParameter featureFlagExtensionsAPI=true --loadExtensions /home/ubuntu/mongo/bazel-bin/install-dist-test/lib/libduplicate_stage_descriptor_bad_extension.so 

      The reason we are not seeing the error message being propagated to the host, is because when we construct the ExtensionStatusException in the SDK, we don't correctly initialize the reason string. 

      As a potential fix, pass in the DBException's reason string to the constructor call here https://github.com/10gen/mongo/blob/master/src/mongo/db/extension/sdk/extension_status.h#L294

      We'll also need to accommodate the case where other exceptions (i.e non DBExceptions) are thrown. 

      We may want to use some generalized code like the one in exceptionToStatus , to ensure we provide a valid reason for all the exception types we expect to throw.

       

            Assignee:
            Finley Lau
            Reporter:
            Santiago Roche
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: