Skip to content

Commit 0902fe8

Browse files
committed
DATACMNS-1819 - Use awaitSingleOrNull to bridge Publisher to Coroutines Repositories.
We're now awaiting completion of the underlying Publisher to ensure all completion tasks have finished before continuing with the execution. This is to avoid completion running in parallel to the actual coroutine as not awaiting completion can result in race conditions.
1 parent 84d9ef0 commit 0902fe8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/springframework/data/repository/core/support/RepositoryMethodInvoker.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ private Object doInvokeReactiveToSuspended(Class<?> repositoryInterface, Reposit
182182
result = (Publisher<?>) collectToList(result);
183183
}
184184

185-
return AwaitKt.awaitFirstOrNull(result, continuation);
185+
return AwaitKt.awaitSingleOrNull(result, continuation);
186186
} catch (Exception e) {
187187
multicaster.notifyListeners(method, args, computeInvocationResult(invocationResultCaptor.error(e)));
188188
throw e;

0 commit comments

Comments
 (0)