[SERVER-32259] Improve error handling for fetchTypeAndSourceURI() Created: 11/Dec/17 Updated: 30/Oct/23 Resolved: 23/Jan/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Storage |
| Affects Version/s: | None |
| Fix Version/s: | 3.6.3, 3.7.2 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Eric Milkie | Assignee: | Ian Whalen (Inactive) |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | ALL | ||||||||
| Backport Requested: |
v3.6
|
||||||||
| Participants: | |||||||||
| Linked BF Score: | 0 | ||||||||
| Description |
|
WiredTigerUtil::fetchTypeAndSourceURI() is using invariant(colgroupResult.isOK()) instead of invariantOK(colgroupResult). This means if the invariant ever fires, we don't know what the bad Status actually was. |
| Comments |
| Comment by Githook User [ 30/Jan/18 ] |
|
Author: {'email': 'cramaechi@me.com', 'name': 'Chibuikem Amaechi', 'username': 'cramaechi'}Message: WiredTigerUtil::fetchTypeAndSourceURI() is using Signed-off-by: Ian Whalen <ian.whalen@gmail.com> |
| Comment by Githook User [ 23/Jan/18 ] |
|
Author: {'name': 'Chibuikem Amaechi', 'email': 'cramaechi@me.com', 'username': 'cramaechi'}Message: WiredTigerUtil::fetchTypeAndSourceURI() is using Signed-off-by: Ian Whalen <ian.whalen@gmail.com> |
| Comment by Chibuikem Amaechi [ 16/Jan/18 ] |
|
Great. I will open a pull request by the end of today! |
| Comment by Michael Cahill (Inactive) [ 16/Jan/18 ] |
|
cramaechi, agreed, a pull request for this change would be great. Thanks! |
| Comment by Chibuikem Amaechi [ 29/Dec/17 ] |
|
As mentioned above, WiredTigerUtil::fetchTypeAndSourceURI() in mongo/src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp is using an overloaded legacy invariant() that, as described by its documentation, only prints the associated condition, file name, and line number when the condition fails. But if what we want is a detailed description of the status when it is bad (i.e., the error code and a description of what caused the error), we are going to have to use invariantOK() instead of invariant(). If everyone is in agreement, I will open a pull request. Edit: Best Regards, |