[SERVER-42080] Verify that stdx::unordered_map/unordered_set throws from at() Created: 03/Jul/19 Updated: 29/Oct/23 Resolved: 15/Aug/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 4.3.1 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Benjamin Caimano (Inactive) | Assignee: | ADAM Martin (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Sprint: | Dev Tools 2019-08-12, Dev Tools 2019-08-26 | ||||||||
| Participants: | |||||||||
| Description |
|
Abseil calls abort() instead of throwing std::out_of_range. We should patch this at least in our vendoring. We could simply throw std::out_of_range like reasonable people or use abseil's throw delegate. |
| Comments |
| Comment by Githook User [ 15/Aug/19 ] | |||||||||||||
|
Author: {'name': 'ADAM David Alan Martin', 'email': 'adam.martin@10gen.com', 'username': 'adamlsd'}Message: Added a test to check that this happens. | |||||||||||||
| Comment by Mira Carey [ 08/Jul/19 ] | |||||||||||||
|
Yeah, this isn't move ops. It's what happens when you do:
I.e. table stakes for basic functionality, where a basic idiom is implemented incorrectly. For what it's worth, I can see codepaths in our code that are broken because we'rd on abseil. See: https://github.com/mongodb/mongo/blob/7eab0b598578261829a7adce6330ae7eff2894a1/src/mongo/shell/kms.cpp#L66
Note that _factories is a stdx::unordered_map. If that pointed to std, this function would throw (as it clearly expects to given the uassert) when seeing provider for the first time. On abseil it terminates the process. | |||||||||||||
| Comment by Billy Donahue [ 08/Jul/19 ] | |||||||||||||
|
They're willing to invest in exception safety and compliance*. h ttps://github.com/abseil/abseil-cpp/issues/37
* They do have a nonstandard "stance" on nothrow move ops, but I don't think that's what we're talking about here. |