This is an automated email from the ASF dual-hosted git repository. rcordier pushed a commit to branch postgresql in repository https://gitbox.apache.org/repos/asf/james-project.git
commit 81a8d903b986ef5043eae7352f02ed6723ca8e8b Author: Quan Tran <[email protected]> AuthorDate: Mon Apr 8 10:16:32 2024 +0700 JAMES-2586 Mitigate fix for https://github.com/jOOQ/jOOQ/issues/16556 jooq reactive bug: SELECT many records then query something else would hang This is a temporary fix in the meantime waiting for the jooq fix. Bear in mind that `.collectList` lot of elements could impact performance. --- .../java/org/apache/james/backends/postgres/utils/PostgresExecutor.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backends-common/postgres/src/main/java/org/apache/james/backends/postgres/utils/PostgresExecutor.java b/backends-common/postgres/src/main/java/org/apache/james/backends/postgres/utils/PostgresExecutor.java index ed192af428..cb63a7e4f7 100644 --- a/backends-common/postgres/src/main/java/org/apache/james/backends/postgres/utils/PostgresExecutor.java +++ b/backends-common/postgres/src/main/java/org/apache/james/backends/postgres/utils/PostgresExecutor.java @@ -116,6 +116,8 @@ public class PostgresExecutor { .flatMapMany(queryFunction) .timeout(postgresConfiguration.getJooqReactiveTimeout()) .doOnError(TimeoutException.class, e -> LOGGER.error(JOOQ_TIMEOUT_ERROR_LOG, e)) + .collectList() + .flatMapIterable(list -> list) // Mitigation fix for https://github.com/jOOQ/jOOQ/issues/16556 .retryWhen(Retry.backoff(MAX_RETRY_ATTEMPTS, MIN_BACKOFF) .filter(preparedStatementConflictException())); } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
