[SERVER-55567] Add Client::isInternal() method to abstract a common idiom Created: 26/Mar/21  Updated: 13/Jun/23

Status: Backlog
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Eric Cox (Inactive) Assignee: Backlog - Service Architecture
Resolution: Unresolved Votes: 0
Labels: sa-remove-fv-backlog-22
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-71099 Remove Session Tags and Cleanup Egres... Closed
Assigned Teams:
Service Arch
Participants:

 Description   

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.



 Comments   
Comment by Matt Diener (Inactive) [ 27/Apr/23 ]

Note: we can probably get away with leaving this out of the project, or leaving it to the discretion of whoever does SERVER-71099

Comment by Matt Diener (Inactive) [ 05/Oct/22 ]

Bringing this into the Session refactor. Although the design is not complete, we are likely to clean up the flags. Having this code duplication will make that more difficult, and this task will inevitably be worked on.

Generated at Thu Feb 08 05:36:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.