-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Internal Code
-
Fully Compatible
-
ALL
-
v5.0
-
3
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); }
- is caused by
-
SERVER-54408 Rewrite AsyncTry-until to not use future recursion
- Closed