Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R2DBC client: ClickHouseResult map implementation logs but doesn't propagate exceptions. #1819

Open
andrescrz opened this issue Sep 10, 2024 · 0 comments
Labels

Comments

@andrescrz
Copy link

Describe the bug

For the R2DBC client, in ClickHouseResult class, the map method implementation logs but doesn't propagate exceptions. However, in the same class the flatMap method implementation both logs and propagates exceptions. See code:

Steps to reproduce

  1. Execute any statement producing aResult object.
  2. Any error triggered within the biFunction argument passed to map will be logged but not propagated. For instance, just throw a new IllegalArgumentException.
  3. Exception is logged but not propagated.

Expected behaviour

Unpropagated exceptions highly increases the chances of errors being unnoticed, unless logs are observed or analysed.

The expected behaviour is propagating the exception, like flatMap method does.

Code example

import io.r2dbc.spi.ConnectionFactory;
import reactor.core.publisher.Mono;

public class ClickHouseRepository {

    ConnectionFactory connectionFactory;

    Mono<Void> example() {
        return Mono.from(connectionFactory.create())
                .flatMapMany(connection -> connection.createStatement("SELECT 1").execute())
                .map(result -> result.map((row, rowMetadata) -> new IllegalArgumentException()))
                .then();
    }
}

Error log

Provided function caused exception: IllegalArgumentException

However, exception is just logged and not propagated.

Configuration

Environment

  • Client version: 0.6.5.
  • Language version: Java.
  • OS: Mac, Linux.

ClickHouse server

  • ClickHouse Server version: 24.3.8.13.
  • ClickHouse Server non-default settings, if any: N/A.
  • CREATE TABLE statements for tables involved: N/A.
  • Sample data for all these tables, use clickhouse-obfuscator if necessary: N/A.
@andrescrz andrescrz added the bug label Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant