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

Add Client::isInternal() method to abstract a common idiom

    • Server Programmability

      We seem to be using this idiom in a growing number of places in the query codebase:

      const auto isInternalClient = !opCtx->getClient()->session() ||
              (opCtx->getClient()->session()->getTags() & transport::Session::kInternalClient);
      

      It would be nice to have a helper Client::isInternal().

      In addition to introducing the helper function, existing code that explicitly checks the `kInternalClient` flag should use the new helper function when possible.

            Assignee:
            Unassigned Unassigned
            Reporter:
            eric.cox@mongodb.com Eric Cox (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: