Details
-
Bug
-
Resolution: Fixed
-
Major - P3
-
None
-
Fully Compatible
-
ALL
-
v5.0
-
3
Description
The change from using .onCompletion() to using .getAsync() in SERVER-54408 made it so any exceptions thrown by the until() lambda are left uncaught. This leads the process to crash, specifically from the lambda called by mongo::ExecutorFuture<T>::getAsync() being wrapped in another lambda that is marked noexcept. AsyncTry should instead handle this exception and return a future ready with the exception as an error status.
TEST_F(AsyncTryUntilTest, UntilBodyPropagatesErrorToCaller) {
|
auto resultFut = AsyncTry([] {})
|
.until([](Status status) {
|
uasserted(ErrorCodes::InternalError, "test error"); |
return true; |
})
|
.on(executor(), CancellationToken::uncancelable());
|
|
|
ASSERT_EQ(resultFut.getNoThrow(), ErrorCodes::InternalError);
|
}
|
Attachments
Issue Links
- is caused by
-
SERVER-54408 Rewrite AsyncTry-until to not use future recursion
-
- Closed
-