[SERVER-51770] generalize errnoWithDescription to handle <system_error> categories Created: 20/Oct/20 Updated: 29/Oct/23 Resolved: 16/Mar/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code |
| Affects Version/s: | None |
| Fix Version/s: | 6.0.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Billy Donahue | Assignee: | Billy Donahue |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | sa-groomed | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Sprint: | Service Arch 2022-03-21 | ||||||||
| Participants: | |||||||||
| Description |
|
(split from Errors from different number spaces are being conflated and misreported. Fortunately C++11 has a solution to this problem. We should be using <system_error> to propagate error categories when we capture errno-style results into C++ with type safety. This should be a simple but repetitive change affecting places where we encounter system API errors and try to log them. Then something like errnoWithDescription (which would be renamed) can be assured to give correct results. Windows has POSIX errno AND it also has its own number spaces like the GetLastError DWORD errors. Other APIs in Linux and Windows will introduce their own number spaces, asio, libresolv, openssl, even mongodb itself.
I'm not sure if this ticket and |
| Comments |
| Comment by Githook User [ 16/Mar/22 ] |
|
Author: {'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}Message: Remove errnoWithPrefix, errnoAndDescription |
| Comment by Githook User [ 16/Mar/22 ] |
|
Author: {'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}Message: |