[SERVER-54596] 1-arg shouldLog violates One Definition Rule Created: 17/Feb/21 Updated: 29/Oct/23 Resolved: 18/Mar/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code |
| Affects Version/s: | None |
| Fix Version/s: | 4.9.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Billy Donahue | Assignee: | Billy Donahue |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | servicearch-wfbf-day | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | ALL | ||||||||
| Sprint: | Security 2021-03-22 | ||||||||
| Participants: | |||||||||
| Story Points: | 2 | ||||||||
| Description |
|
[subtask of SERVER-52604] mongo::shouldLog(component, severity) is fine. mongo::shouldLog(severity) fills in the default component by referring to a variable in the anonymous namespace. So a program will have multiple mongo::shouldLog(severity) definitions, all referring to completely different component variables. This is a violation of the One Definition Rule. Can be easily fixed, just remove the 1-arg shouldLog function. Replace all callers (7 or so) with shouldLog(MONGO_LOGV2_DEFAULT_COMPONENT, severity) https://github.com/mongodb/mongo/commit/955af4ef6fa94b76a24faa810435181b5ee3e140
|
| Comments |
| Comment by Githook User [ 18/Mar/21 ] |
|
Author: {'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}Message: |
| Comment by Githook User [ 18/Mar/21 ] |
|
Author: {'name': 'Billy Donahue', 'email': 'billy.donahue@gmail.com', 'username': 'BillyDonahue'}Message: |