Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-88953

ServerParameter onUpdate handlers accept OperationContext

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Server Programmability
    • Fully Compatible
    • 0

      The callback registered for an IDL on_update definition currently only receives the updated value of the server parameter. When the update is performed as the result of a setParameter command, users need to use the following pattern:

       if (auto client = Client::getCurrent()) { 
           ... get the svxCtx or opCtx from client and use it
       }
       return Status::OK();

       Since the update handler is being invoked from a command, we already have a client and an OperationContext for the command, and we should pass that in to the handler. 

            Assignee:
            matt.broadstone@mongodb.com Matt Broadstone
            Reporter:
            matt.broadstone@mongodb.com Matt Broadstone
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: